-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpostcss.config.js
More file actions
38 lines (35 loc) · 1003 Bytes
/
postcss.config.js
File metadata and controls
38 lines (35 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* External dependencies
*/
const path = require('path');
const postcssGlobalData = require('@csstools/postcss-global-data');
const postcssImport = require('postcss-import');
const postcssMixins = require('postcss-mixins');
const postcssCustomMedia = require('postcss-custom-media');
const postcssMediaMinMax = require('postcss-media-minmax');
const postcssNesting = require('postcss-nesting');
const postcssDiscardComments = require('postcss-discard-comments');
const autoprefixer = require('autoprefixer');
const cssnano = require('cssnano');
module.exports = (ctx) => {
const config = {
plugins: [
postcssGlobalData({
files: [path.resolve(`${__dirname}/vendor/t2/utils/src/custom-media.css`)],
}),
postcssImport,
postcssMixins,
postcssCustomMedia,
postcssMediaMinMax,
postcssNesting({
noIsPseudoSelector: true,
}),
postcssDiscardComments,
autoprefixer,
],
};
if (ctx.env === 'production') {
config.plugins.push(cssnano());
}
return config;
};