-
Notifications
You must be signed in to change notification settings - Fork 0
/
postcss.config.js
33 lines (32 loc) · 978 Bytes
/
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
const { resolve } = require('path');
module.exports = ctx => ({
map: ctx.env === 'development' ? ctx.map : false,
from: ctx.form,
to: ctx.to,
plugins: {
stylelint: {},
'postcss-import': {
addDependencyTo: ctx.webpack,
path: [resolve(__dirname, 'src/styles')],
},
'postcss-svg': {
paths: [resolve(__dirname, 'src/assets/svg')],
svgo: ctx.env === 'production',
},
'postcss-assets': {
loadPaths: [
'assets',
'scripts',
],
basePath: resolve(__dirname, 'src'),
cachebuster: ctx.env === 'production',
},
'postcss-size': {},
'postcss-position': {},
'postcss-cssnext': { warnForDuplicates: ctx.env === 'development' },
'postcss-font-magician': {},
'postcss-reporter': ctx.env === 'development' ? {} : false,
'postcss-browser-reporter': ctx.env === 'development' ? { selector: 'body:after' } : false,
cssnano: ctx.env === 'production' ? {} : false,
},
});