@coco-platform/webpack-plugin-html-minify
v0.2.0
Published
A lite project to develop webpack plugin.
Downloads
10
Readme
@coco-platform/webpack-plugin-html-minify
Cooperate with html-webpack-plugin
, take place build-in html minify, which make life cycle more clear.
Usage
# npm
npm install @coco-platform/webpack-plugin-html-minify --only=dev;
# yarn
yarn add @coco-platform/webpack-plugin-html-minify --dev;
Options
Please see https://github.com/kangax/html-minifier#options-quick-reference for complete options.
Example
Then config the webpack:
const configuration = {
entry: path.resolve(__dirname, '__fixture__', 'index.js'),
resolve: {
extensions: ['.js', '.css'],
},
output: {
path: path.resolve(process.cwd(), 'dist'),
filename: '[name].js',
publicPath: '/',
},
module: {
rules: [],
},
plugins: [
Reflect.construct(HtmlWebpackPlugin, [
{
template: path.resolve(__dirname, '__fixture__', 'index.html'),
inject: 'body',
},
]),
Reflect.construct(HtmlMinifyPlugin, []),
],
};
License
MIT