36 lines
594 B
JavaScript
36 lines
594 B
JavaScript
const dev = process.env.NODE_ENV === 'development'
|
|
|
|
let config = {
|
|
plugins: {
|
|
// Preset Env
|
|
'postcss-preset-env': {
|
|
|
|
},
|
|
|
|
// Autoprefixer
|
|
autoprefixer: {
|
|
|
|
},
|
|
|
|
// Extract media queries
|
|
// 'postcss-combine-media-query': {
|
|
|
|
// }
|
|
}
|
|
}
|
|
|
|
// Production only
|
|
// CSS Nano for production
|
|
if (!dev) {
|
|
config.plugins.cssnano = {
|
|
preset: 'default',
|
|
autoprefixer: true,
|
|
discardComments: { removeAll: true },
|
|
calc: { precision: 2 },
|
|
safe: true
|
|
}
|
|
}
|
|
|
|
// Export
|
|
module.exports = config
|