Setup PostCSS
This commit is contained in:
13
package.json
13
package.json
@@ -11,9 +11,18 @@
|
||||
"type": "git",
|
||||
"url": "git://github.com/cartodb/CartoAssets.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"perfect-scrollbar": "git://github.com/CartoDB/perfect-scrollbar.git#master"
|
||||
"perfect-scrollbar": "git://github.com/CartoDB/perfect-scrollbar.git#master",
|
||||
"postcss": "^5.2.8",
|
||||
"postcss-browser-reporter": "^0.5.0",
|
||||
"postcss-cli": "^2.6.0",
|
||||
"postcss-cssnext": "^2.9.0",
|
||||
"postcss-import": "^9.0.0",
|
||||
"postcss-reporter": "^3.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "postcss -c postcss.config.js"
|
||||
},
|
||||
"keywords": [
|
||||
"library",
|
||||
|
||||
26
postcss.config.js
Normal file
26
postcss.config.js
Normal 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;
|
||||
Reference in New Issue
Block a user