Rollup plugin to minify HTML template literal strings, forked from the official rollup-plugin-minify-html-literals to support Rollup v3 and later (including Rollup v4). Version 1.3.4 ships TypeScript types and works as a drop-in replacement. The plugin minifies tagged template literals (e.g., lit-html, html`...`, css`...`), with fine-grained include/exclude filters. It wraps the minify-html-literals library and offers full options passthrough. Compared to the original, this fork updates the Rollup peer dependency range; no code changes beyond that. Official repo is still on Rollup v2, so this fork remains active until upstream is updated.
npm install rollup-plugin-minify-html-literals-v3Verified import paths — ran on the pinned version, not inferred.
Basic rollup.config.js using default import of the plugin with include filter and custom minify options.
Ensure you have the correct package name: rollup-plugin-minify-html-literals-v3
Use import syntax or dynamic import with .default as shown in imports.
If using Rollup v4, ensure rollup-plugin-minify-html-literals-v3 is at version 1.3.0 or higher.
Review default minify options and override if needed – especially keepClosingSlash and collapseBooleanAttributes.
Set include: '**/*.js' or a more specific minimatch pattern to avoid unexpectedly processing non-JS files.
Change to import syntax: import minifyLiterals from 'rollup-plugin-minify-html-literals-v3'
Remove curly braces: import minifyLiterals from 'rollup-plugin-minify-html-literals-v3'
Rename file to rollup.config.js (not .cjs) and use import syntax, or use dynamic import.
Install minify-html-literals: npm install minify-html-literals