Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rsbuild-plugin-html-minifier-terser

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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.

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

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.

FAQs

Package last updated on 07 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc