Vite plugin to minify HTML output using html-minifier-next. Current version 3.0.0, requires Vite >=5. Lightweight alternative to @vitejs/plugin-legacy or manual minification. Ships TypeScript types and focuses on production builds. Released under MIT license, maintained actively.
npm install vite-plugin-minifyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage of ViteMinifyPlugin in a Vite config with common html-minifier-next options.
Update options to match html-minifier-next API.
No workaround needed; this is by design.
Use import { ViteMinifyPlugin } from 'vite-plugin-minify'.Upgrade Vite to version 5 or above.
Change to import { ViteMinifyPlugin } from 'vite-plugin-minify'.Ensure html-minifier-next is installed as a dependency: npm install html-minifier-next --save-dev
Pass a plain object with html-minifier-next options, e.g., ViteMinifyPlugin({ collapseWhitespace: true }).No dependency data recorded yet.