-
Notifications
You must be signed in to change notification settings - Fork 17
/
postcss.config.js
37 lines (36 loc) · 1.04 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
var glob = require('glob');
/**
* Due to https://github.com/egoist/rollup-plugin-postcss/compare/v2.4.0...v2.4.1
* switching from push to unshift it's not possible to upgrade past 2.4.0 as long
* as postcss-import is used.
*/
module.exports = context => {
return {
plugins: [
require('postcss-import'),
require('postcss-mixins')({
mixins: require('./src/postcss/mixins'),
}),
require('postcss-simple-vars')({
variables: () => require('./src/postcss/vars'),
}),
require('postcss-custom-media')({
importFrom: [{ customMedia: require('./src/postcss/vars/mediaRules.json') }],
}),
require('postcss-nested'),
require('postcss-extend-rule'),
require('autoprefixer'),
require('cssnano')({
preset: [
'default',
{
mergeLonghand: false,
discardEmpty: true,
normalizeWhitespace: true,
},
],
}),
context.options.prettify && require('postcss-prettify'),
].filter(Boolean),
};
};