Setup PostCSS

This commit is contained in:
rubenmoya
2017-12-22 13:35:13 +01:00
parent 93c1b97401
commit 13118b78db
4 changed files with 1844 additions and 2 deletions
+26
View File
@@ -0,0 +1,26 @@
const POSTCSS = {
'input': 'src/entry.css',
'output': 'dist/carto_assets.css',
'use': [
'postcss-import',
'postcss-cssnext'
// 'postcss-browser-reporter',
// 'postcss-reporter'
],
'postcss-import': {
path: ['src']
},
'cssnano': {
safe: true,
autoprefixer: false //handled by postcss-cssnext
},
'local-plugins': true,
'map': 'file'
}
if (process.env.NODE_ENV === 'production') {
POSTCSS.use.push('cssnano'); // add cssnano in production
POSTCSS.map = false; //sourcemaps to external file
}
module.exports = POSTCSS;