Registry / devops / reptar-html-minifier

reptar-html-minifier

JSON →
library2.0.0jsnpmunverified

A Reptar plugin that integrates html-minifier into the didBuild lifecycle step. Current stable version is 2.0.0, with infrequent releases. It allows configuring html-minifier options via a simple function call. Key differentiator: it is purpose-built for Reptar static site generator, unlike general HTML minifiers. Alternatives include using html-minifier directly or other build tools.

npm install reptar-html-minifier
INSTALL
IMPORT
SIG · REPTAR-HTML-MINIFI
R
reptar-html-minifier
devopsjavascriptv2.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

reptarHtmlMinifier
const reptarHtmlMinifier = require('reptar-html-minifier');
import reptarHtmlMinifier from 'reptar-html-minifier';
CommonJS only; no ESM support.

Install and configure reptar-html-minifier in your Reptar config to minify HTML after build.

const reptarHtmlMinifier = require('reptar-html-minifier'); module.exports = { lifecycle: { didBuild: reptarHtmlMinifier({ collapseBooleanAttributes: true, collapseWhitespace: true, removeAttributeQuotes: true, removeComments: true, removeEmptyAttributes: true, removeRedundantAttributes: true }) } };
Debug
Known issues
gotchaPlugin only works with Reptar; ensure you have Reptar installed and project is Reptar-based.
fix
Install Reptar first: npm install reptar
affects: >=0.1.0
deprecatedhtml-minifier has known bugs and is unmaintained; consider using html-minifier-terser with custom integration.
fix
Replace plugin with custom didBuild function using html-minifier-terser.
affects: >=0.1.0
gotchaOptions are passed verbatim to html-minifier; invalid options cause silent failures.
fix
Validate options against html-minifier documentation before adding them.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'html-minifier'
Missing dependency html-minifier as it is a peer dependency.
fix
Run: npm install html-minifier
TypeError: reptarHtmlMinifier is not a function
Incorrect import: using default import in ESM context or forgetting parentheses.
fix
Use: const reptarHtmlMinifier = require('reptar-html-minifier'); then call reptarHtmlMinifier({...}) as a function.
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies
html-minifierrequiredcore minification engine
Agent activity
4 hits · last 30 days
node
4
Resources
reptar-html-minifier — npm install reptar-html-minifier · libregistry