CSSO minification files to serve your webpack bundles
npm install csso-webpack-plugin
Why is not csso-loader or postcss-csso?
* Full restructuring in bundles:
!better
* No problems with custom syntax like css-modules – :global(.c .d) .a { color: #fff; }

* Possible to generate both pure and minimized versions at the same time.
bash
npm i -D csso-webpack-plugin
`For
node < 8.0.0 use 1.x version with csso@^3:
`bash
npm i -D csso-webpack-plugin@1
`Usage
Plugin good to use in pair with ExtractTextPlugin or MiniCssExtractPlugin.
`js
const CssoWebpackPlugin = require('csso-webpack-plugin').default;module.exports = {
module: { / ... / },
plugins: [
new MiniCssExtractPlugin({
filename: "[name].css",
chunkFilename: "[id].css"
}),
new CssoWebpackPlugin(),
]
}
`Options
`js
new CssoWebpackPlugin([options: CssoOptions], [filter: function | RegExp])
`Arguments:
*
options — csso options.
options.pluginOutputPostfix — function(file) or string postfix*, if passed, plugin will create two assets vanilla and compressed.
Example:
`javascript
{
plugins: [
new ExtractTextPlugin('test.css'),
new CssoWebpackPlugin({ pluginOutputPostfix: 'min' })
/* Generated:
test.css — uncompressed file
test.min.css — minimized with csso file
*/
]
}
`
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
``[npm]: https://img.shields.io/npm/v/csso-webpack-plugin.svg
[npm-url]: https://npmjs.com/package/csso-webpack-plugin
[node]: https://img.shields.io/node/v/csso-webpack-plugin.svg
[node-url]: https://nodejs.org
[deps]: https://david-dm.org/zoobestik/csso-webpack-plugin.svg
[deps-url]: https://david-dm.org/zoobestik/csso-webpack-plugin
[tests]: http://img.shields.io/travis/zoobestik/csso-webpack-plugin.svg
[tests-url]: https://travis-ci.org/zoobestik/csso-webpack-plugin
[cover]: https://coveralls.io/repos/github/zoobestik/csso-webpack-plugin/badge.svg
[cover-url]: https://coveralls.io/github/zoobestik/csso-webpack-plugin