@applaud/optimize-cssnano-plugin
v1.0.3
Published
WebPack 2+ plugin for CSS minification after ExtractTextPluging
Downloads
25
Maintainers
Readme
@applaud/optimize-cssnano-plugin
It will search for CSS assets during the Webpack build and minimize it with cssnano. Solves extract-text-webpack-plugin CSS duplication problem.
Just like optimize-css-assets-webpack-plugin but more accurate with source maps.
Installation:
Using npm:
$ npm install --save-dev @applaud/optimize-cssnano-plugin
Configuration:
const OptimizeCssnanoPlugin = require('@applaud/optimize-cssnano-plugin');
module.exports = {
module: {
loaders: [
{ test: /\.css$/, loader: ExtractTextPlugin.extract("style-loader", "css-loader") }
]
},
plugins: [
new ExtractTextPlugin("styles.css"),
new OptimizeCssnanoPlugin({
sourceMap: nextSourceMap,
cssnanoOptions: {
preset: ['default', {
discardComments: {
removeAll: true,
},
}],
},
}),
]
}