Registry / devops / rollup-plugin-minify-html-literals-v3

rollup-plugin-minify-html-literals-v3

JSON →
library1.3.4jsnpmunverified

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-v3
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-MINI
R
rollup-plugin-minify-html-literals-v3
devopsjavascriptv1.3.4
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–223 runs
build_error
glibc
node 18–223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
✓ import minifyLiterals from 'rollup-plugin-minify-html-literals-v3'
✗ import { minifyLiterals } from 'rollup-plugin-minify-html-literals-v3'
The plugin is exported as default, not a named export.
minifyLiterals
✓ import minifyLiterals from 'rollup-plugin-minify-html-literals-v3'
✗ const minifyLiterals = require('rollup-plugin-minify-html-literals-v3')
Package is ESM-only. Cannot be used with require().
minifyLiterals (CommonJS workaround)
✓ const minifyLiterals = (await import('rollup-plugin-minify-html-literals-v3')).default
✗ const minifyLiterals = require('rollup-plugin-minify-html-literals-v3')
If you must use CommonJS, use dynamic import and access .default.

Basic rollup.config.js using default import of the plugin with include filter and custom minify options.

// rollup.config.js import minifyLiterals from 'rollup-plugin-minify-html-literals-v3'; export default { input: 'src/index.js', output: { file: 'dist/bundle.js', format: 'esm' }, plugins: [ minifyLiterals({ include: 'src/**/*.js', options: { minifyOptions: { caseSensitive: true, collapseWhitespace: true } } }) ] };
Debug
Known issues
breakingThis package is a fork; do not confuse with the original rollup-plugin-minify-html-literals
fix
Ensure you have the correct package name: rollup-plugin-minify-html-literals-v3
affects: >=1.0.0
gotchaThe plugin is ESM-only. Using require() will throw an error.
fix
Use import syntax or dynamic import with .default as shown in imports.
affects: >=1.0.0
deprecatedRollup v3 support is being phased out; this package works with Rollup v4 but may require updating peer dependencies.
fix
If using Rollup v4, ensure rollup-plugin-minify-html-literals-v3 is at version 1.3.0 or higher.
affects: >=1.3.0
gotchaThe options.minifyOptions are passed directly to html-minifier; some defaults may over-minify (e.g., removing quotes, unsafe for attributes).
fix
Review default minify options and override if needed – especially keepClosingSlash and collapseBooleanAttributes.
affects: >=1.0.0
gotchaIncluding or excluding files: default include is all files; if you only want to minify certain extensions, set include explicitly.
fix
Set include: '**/*.js' or a more specific minimatch pattern to avoid unexpectedly processing non-JS files.
affects: >=1.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
Using require() on this ESM-only package.
fix
Change to import syntax: import minifyLiterals from 'rollup-plugin-minify-html-literals-v3'
TypeError: minifyLiterals is not a function
Named import instead of default import: import { minifyLiterals } from ...
fix
Remove curly braces: import minifyLiterals from 'rollup-plugin-minify-html-literals-v3'
The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
Rollup config file using CommonJS require inside an ESM context.
fix
Rename file to rollup.config.js (not .cjs) and use import syntax, or use dynamic import.
Could not resolve 'minify-html-literals'
Missing dependency, or incorrect import path.
fix
Install minify-html-literals: npm install minify-html-literals
Upgrade
Version history
1.3.4latest on npm
Audit
Dependencies
rolluprequiredpeer dependency, plugin API
minify-html-literalsrequiredcore minification logic
Agent activity
2 hits · last 30 days
node
2
Resources
rollup-plugin-minify-html-literals-v3 — npm install rollup-plugin-minify-html-literals-v3 · libregistry