A Webpack plugin to minimize HTML files.
It will search for HTML files during the Webpack build and will minimize the HTML with HTMLMinifier.
The plugin pass the configuration to HTMLMinifier, defaults to {}
.
var HtmlMinifierPlugin = require('html-minifier-webpack-plugin');
module.exports = {
module: {
loaders: [
{ test: /\.html$/, loaders: ['file-loader?name=[name].html', 'extract-loader', 'html-loader'] }
]
},
plugins: [
new HtmlMinifierPlugin({
// HTMLMinifier options
})
]
}