{"id":22129,"library":"rollup-plugin-minify-html-literals-v3","title":"rollup-plugin-minify-html-literals-v3","description":"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.","status":"active","version":"1.3.4","language":"javascript","source_language":"en","source_url":"https://github.com/ouweiya/rollup-plugin-minify-html-literals-v3","tags":["javascript","rollup-plugin","minify","html","literal","literals","template","tagged","lit-html","typescript"],"install":[{"cmd":"npm install rollup-plugin-minify-html-literals-v3","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-minify-html-literals-v3","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-minify-html-literals-v3","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency, plugin API","package":"rollup","optional":false},{"reason":"core minification logic","package":"minify-html-literals","optional":false}],"imports":[{"note":"The plugin is exported as default, not a named export.","wrong":"import { minifyLiterals } from 'rollup-plugin-minify-html-literals-v3'","symbol":"default","correct":"import minifyLiterals from 'rollup-plugin-minify-html-literals-v3'"},{"note":"Package is ESM-only. Cannot be used with require().","wrong":"const minifyLiterals = require('rollup-plugin-minify-html-literals-v3')","symbol":"minifyLiterals","correct":"import minifyLiterals from 'rollup-plugin-minify-html-literals-v3'"},{"note":"If you must use CommonJS, use dynamic import and access .default.","wrong":"const minifyLiterals = require('rollup-plugin-minify-html-literals-v3')","symbol":"minifyLiterals (CommonJS workaround)","correct":"const minifyLiterals = (await import('rollup-plugin-minify-html-literals-v3')).default"}],"quickstart":{"code":"// rollup.config.js\nimport minifyLiterals from 'rollup-plugin-minify-html-literals-v3';\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    file: 'dist/bundle.js',\n    format: 'esm'\n  },\n  plugins: [\n    minifyLiterals({\n      include: 'src/**/*.js',\n      options: {\n        minifyOptions: {\n          caseSensitive: true,\n          collapseWhitespace: true\n        }\n      }\n    })\n  ]\n};","lang":"javascript","description":"Basic rollup.config.js using default import of the plugin with include filter and custom minify options."},"warnings":[{"fix":"Ensure you have the correct package name: rollup-plugin-minify-html-literals-v3","message":"This package is a fork; do not confuse with the original rollup-plugin-minify-html-literals","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use import syntax or dynamic import with .default as shown in imports.","message":"The plugin is ESM-only. Using require() will throw an error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"If using Rollup v4, ensure rollup-plugin-minify-html-literals-v3 is at version 1.3.0 or higher.","message":"Rollup v3 support is being phased out; this package works with Rollup v4 but may require updating peer dependencies.","severity":"deprecated","affected_versions":">=1.3.0"},{"fix":"Review default minify options and override if needed – especially keepClosingSlash and collapseBooleanAttributes.","message":"The options.minifyOptions are passed directly to html-minifier; some defaults may over-minify (e.g., removing quotes, unsafe for attributes).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set include: '**/*.js' or a more specific minimatch pattern to avoid unexpectedly processing non-JS files.","message":"Including or excluding files: default include is all files; if you only want to minify certain extensions, set include explicitly.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.3.4':36 'activ':107 'beyond':94 'chang':93 'code':92 'compar':79 'css':59 'depend':89 'drop':45 'drop-in':44 'e.g':54 'filter':65 'fine':62 'fine-grain':61 'fork':16,84,105 'full':76 'grain':63 'html':5,12,24,57,58,71,117,124 'includ':32 'include/exclude':64 'javascript':112 'later':31 'librari':73 'lit':56,123 'lit-html':55,122 'liter':6,14,25,53,72,118,119 'minifi':4,11,23,50,70,116 'minify-html-liter':69 'offer':75 'offici':19,96 'option':77 'origin':82 'passthrough':78 'peer':88 'plugin':3,9,22,49,115 'rang':90 'remain':106 'replac':47 'repo':97 'rollup':2,8,21,28,33,87,101,114 'rollup-plugin':113 'rollup-plugin-minify-html-liter':20 'rollup-plugin-minify-html-literals-v3':1 'ship':37 'still':99 'string':15 'support':27 'tag':51,121 'templat':13,52,120 'type':39 'typescript':38,125 'updat':85,111 'upstream':109 'v2':102 'v3':7,29 'v4':34 'version':35 'work':41 'wrap':67","created_at":"2026-04-27T17:03:32.448685+00:00","updated_at":"2026-04-27T17:03:32.448685+00:00","problems":[{"fix":"Change to import syntax: import minifyLiterals from 'rollup-plugin-minify-html-literals-v3'","cause":"Using require() on this ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module not supported"},{"fix":"Remove curly braces: import minifyLiterals from 'rollup-plugin-minify-html-literals-v3'","cause":"Named import instead of default import: import { minifyLiterals } from ...","error":"TypeError: minifyLiterals is not a function"},{"fix":"Rename file to rollup.config.js (not .cjs) and use import syntax, or use dynamic import.","cause":"Rollup config file using CommonJS require inside an ESM context.","error":"The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten"},{"fix":"Install minify-html-literals: npm install minify-html-literals","cause":"Missing dependency, or incorrect import path.","error":"Could not resolve 'minify-html-literals'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/ouweiya/rollup-plugin-minify-html-literals-v3","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/rollup-plugin-minify-html-literals-v3","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-18","next_check":"2026-07-26","install_tag":null}}