CSSO Webpack Plugin

Why is not csso-loader or postcss-csso?
Install
npm i -D csso-webpack-plugin
Usage
Plugin good to use in pair with ExtractTextPlugin.
const CssoWebpackPlugin = require('csso-webpack-plugin').default;
module.exports = {
module: { },
plugins: [
new ExtractTextPlugin('[name].css'),
new CssoWebpackPlugin(),
]
}
Options
new CssoWebpackPlugin([options: CssoOptions], [filter: function | RegExp])
Arguments:
options
— csso options.filter
— Detect should be file processed. Defaults: to ends with .css
.
Flow support
I don't now why, but plugin ships with flow typings (typedef too). To use them in your project, add this to the [libs]
section of your .flowconfig
:
[libs]
node_modules/csso-webpack-plugin/lib/index.js.flow
Acknowledgements
