Uses nukecss to eliminate unused css from your webpack bundle. Support for the extract-text-webpack-plugin and for style-loader.
npm install --save-dev nukecss-webpack
const NukeCssPlugin = require('nukecss-webpack')
module.exports = {
entry: 'my-entry.js',
output: {
// ...
},
plugins: [
// ...
new NukecssPlugin()
],
}Before
out.css 146 kB 0 [emitted] main
After
out.css 6.82 kB 0 [emitted] main