nucliweb
9/3/2017 - 9:58 AM

PostCSS Config

PostCSS Config

// PostCSS Config file to use with postcss-cli
module.exports = (ctx) => ({
  map: ctx.env === 'development' ? ctx.map : false,
  plugins: {
    'postcss-devtools': ctx.env === 'development' ? {} : false,
    'postcss-custom-properties': {},
    'postcss-color-function': {},
    'postcss-for': {},
    'postcss-import': {},
    'postcss-math': {},
    'postcss-mixins': {},
    'postcss-nested': {},
    'postcss-focus': {},
    'css-mqpacker': {},
    'postcss-reporter': ctx.env === 'development' ? { clearMessages: true } : false,
    'cssnano': ctx.env === 'production' ? {} : false
  }
})
"scripts": {
  "postcss": "postcss src/css/index.css -o src/css/styles.css -w",
  "build:css": "postcss -e production src/css/index.css -o dist/css/styles.css",
  ...
}