A Vite plugin to minify HTML output in production builds using html-minifier-terser. Version 1.0.2, stable, released via GitHub. Key differentiators: simple integration, full TypeScript support, leverages the robust html-minifier-terser under the hood for configurable minification (collapse whitespace, remove comments, etc.). Lightweight zero-config plugin with optional boolean or MinifyOptions argument. Requires Vite >=2.0.0 and Node >=14.0.0.
npm install vite-plugin-minify-htmlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures Vite to minify HTML with custom html-minifier-terser options.
Explicitly set `apply: 'build'` if needed, or use `apply: 'serve'` for dev server.
Use this plugin and disable Vite's built-in minification if conflicts arise.
Use an options object `{}` to be future-proof.Use `const minifyHtml = require('vite-plugin-minify-html')` without destructuring.Upgrade Vite to ^2.0.0 or newer.