@coco-platform/webpack-plugin-html-minify

0.2.0 • Public • Published

@coco-platform/webpack-plugin-html-minify

Build Status Coverage Status Package Dependency Package DevDependency

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

Readme

Keywords

Package Sidebar

Install

npm i @coco-platform/webpack-plugin-html-minify

Weekly Downloads

0

Version

0.2.0

License

MIT

Unpacked Size

4.2 kB

Total Files

4

Last publish

Collaborators

  • bornkiller
  • trashbox