Skip to content

coco-platform/webpack-plugin-html-minify

Repository files navigation

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

Build Status Coverage Status Greenkeeper badge Package Dependency Package DevDependency

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

About

cooperate with `html-webpack-plugin`, take place build-in html minify, which make life cycle more clear.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •