An Rsbuild plugin that integrates html-minifier-terser to minify HTML outputs during the build process. Current stable version is 1.1.3. Released under MIT license. It provides a seamless way to optimize HTML files generated by Rsbuild, supporting customization of minification options either as an object or a callback function. Unlike other HTML minification plugins, it respects Rsbuild's JavaScript minification settings. It requires @rsbuild/core v1 or v2 (peer dependency) and ships TypeScript type definitions.
npm install rsbuild-plugin-html-minifier-terserNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Add the plugin to Rsbuild config. HTML output will be minified with default html-minifier-terser options.
Ensure your project uses @rsbuild/core@^1.0.0 || ^2.0.0-0
Use a callback to customize options based on defaults: pluginHtmlMinifierTerser((options) => { options.minifyCSS = false; return options; })If you need full control, pass minifyJS, minifyCSS options to the plugin.
N/A
npm add rsbuild-plugin-html-minifier-terser -D
Use import { pluginHtmlMinifierTerser } from 'rsbuild-plugin-html-minifier-terser'npm add @rsbuild/core -D (ensure version ^1.0.0 || ^2.0.0-0)