-
Notifications
You must be signed in to change notification settings - Fork 1
/
postcss.config.js
39 lines (36 loc) · 1 KB
/
postcss.config.js
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
39
/**
* External dependencies
*/
/* const postcssGlobalData = require('@csstools/postcss-global-data'); */
const postcssImport = require('postcss-import');
const postcssMixins = require('postcss-mixins');
const postcssUrl = require('postcss-url');
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: [require.resolve('@teft/viewport/src/media.css')],
}), */
postcssImport,
postcssMixins,
postcssUrl,
postcssCustomMedia,
postcssMediaMinMax,
postcssNesting({
noIsPseudoSelector: true,
}),
postcssDiscardComments,
autoprefixer,
],
};
if (ctx.env === 'production') {
config.plugins.push(cssnano());
}
return config;
};