Webpack plugin: Optimize css class names:
Minimize CSS class names and give minimization up to 70% for css files and ~10% for html template minimization.
FROM :
<div class="long-class-name"></div>
.long-class-name {
}
TO :
<div class="a"></div>
.a {
}
const OptimizeCSSClassnamesPlugin = require('optimize-css-classnames-plugin');
module.exports = {
module: {
rules: [{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: "css-loader"
})
},
{
test: /\.(html)$/,
use: [{
loader: 'html-loader'
}, {
loader: 'optimize-css-classnames-html'
}]
}]
},
plugins: [
new ExtractTextPlugin("styles.css"),
new OptimizeCSSClassnamesPlugin({
prefix: '_',
ignore: [
'blink-class',
/^e2e-/
]
})
]
}