rsbuild-plugin-html-minifier-terser
An Rsbuild plugin to use [html-minifier-terser](https://github.com/terser/html-minifier-terser) to minify the HTML outputs.
Last updated 8 months ago by GitHub Actions .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install rsbuild-plugin-html-minifier-terser 
SYNC missed versions from official npm registry.

rsbuild-plugin-html-minifier-terser

An Rsbuild plugin to use html-minifier-terser to minify the HTML outputs.

npm version license

Usage

Install:

npm add rsbuild-plugin-html-minifier-terser -D

Basic

Add plugin to your rsbuild.config.ts, HTML will be minified by default and JS minimization affected by Rsbuild's config.

// rsbuild.config.ts
import { pluginHtmlMinifierTerser } from 'rsbuild-plugin-html-minifier-terser'

export default {
  plugins: [pluginHtmlMinifierTerser()],
}

Customize options

The plugin could accept an parameter of type HtmlMinifierOptions | ((options: HtmlMinifierOptions) => HtmlMinifierOptions).

  1. Passing options to customize the minification, fields listed in the options will override the default options.

    export default {
      plugins: [
        pluginHtmlMinifierTerser({
          // `minifyCSS` will be set to false
          minifyCSS: false,
        }),
      ],
    }
    
  2. A callback function can be passed to the plugin to customize the minification options based on the default options, and the return value will be used as the final options.

    export default {
      plugins: [
        pluginHtmlMinifierTerser((options) => {
          // customize options here
          return options
        }),
      ],
    }
    

License

MIT.

Current Tags

  • 1.1.2                                ...           latest (8 months ago)

4 Versions

  • 1.1.2                                ...           8 months ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 4
Dependencies (2)
Dev Dependencies (10)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |