html minimizer plugin for Webpack
To begin, you'll need to install html-minimizer-webpack-plugin
:
$ npm install html-minimizer-webpack-plugin --save-dev
Then add the loader to your webpack
config. For example:
Then add the plugin to your webpack
config. For example:
file.ext
import file from 'file.ext';
webpack.config.js
module.exports = {
module: {
rules: [
{
test: /.ext$/,
use: [
{
loader: `htmlminimizer-loader`,
options: { ...options },
},
],
},
],
},
};
webpack.config.js
module.exports = {
plugins: [new HtmlMinimizerPlugin(options)],
};
And run webpack
via your preferred method.
[option]
Type: [type|other-type]
Default: [type|null]
[ option description ]
webpack.config.js
module.exports = {
module: {
rules: [
{
loader: `htmlminimizer-loader`,
options: {
[option]: https://github.com/webpack-contrib/html-minimizer-webpack-plugin/blob/master/%27%27,
},
},
],
},
};
webpack.config.js
module.exports = {
plugins: [
new HtmlMinimizerPlugin({
[option]: https://github.com/webpack-contrib/html-minimizer-webpack-plugin/blob/master/%27%27,
}),
],
};
[ example outline text ]
webpack.config.js
// Example setup here..
file.ext
// Source code here...
bundle.js
// Bundle code here...
Please take a moment to read our contributing guidelines if you haven't yet done so.