Registry / devops / tpack-html-minifier

tpack-html-minifier

JSON →
library2.9.0jsnpmunverified

A TPack plugin that minifies HTML files using html-minifier. Version 2.9.0 is the latest stable release. It integrates seamlessly with TPack's pipe system, allowing developers to compress HTML output during build. The plugin exposes all html-minifier configuration options, such as collapseWhitespace, removeComments, and minifyJS. It is designed specifically for the TPack build tool, not a standalone minifier. Compared to direct use of html-minifier, this plugin provides a convenient TPack-compatible interface. Development appears to be low-frequency, with no recent updates.

npm install tpack-html-minifier
INSTALL
IMPORT
SIG · TPACK-HTML-MINIFIE
T
tpack-html-minifier
devopsjavascriptv2.9.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.

plugin
tpack.plugin('tpack-html-minifier')
const minifier = require('tpack-html-minifier')
This plugin is invoked via tpack.plugin() as part of a pipe, not as a standalone module.
require('tpack-html-minifier')
const tpackHtmlMinifier = require('tpack-html-minifier')
import { tpackHtmlMinifier } from 'tpack-html-minifier'
CommonJS only; no ES module export.

Demonstrates running tpack-html-minifier plugin on HTML files with common options.

// Install: npm install tpack tpack-html-minifier -g const tpack = require('tpack'); // Process all HTML files const stream = tpack.src('*.html').pipe(tpack.plugin('tpack-html-minifier', { collapseWhitespace: true, removeComments: true, minifyCSS: true, minifyJS: true })); // Output to a directory (example) stream.pipe(tpack.dest('dist'));
Debug
Known issues
gotchaPlugin must be called via tpack.plugin() with the exact string 'tpack-html-minifier'; exporting the module directly does not work.
fix
Use tpack.plugin('tpack-html-minifier') in the pipe.
affects: >=0.0.0
gotchaSome options like removeComments are automatically set by the plugin (see README note [1]), overriding user config may cause unexpected behavior.
fix
Check the plugin source to understand forced options.
affects: >=0.0.0
gotchaGlobal installation (-g) is recommended but may cause version conflicts if multiple projects need different versions.
fix
Consider local install per project.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: tpack.plugin is not a function
tpack is not installed or not properly required (CommonJS).
fix
Install tpack: npm install tpack, and require it: const tpack = require('tpack');
Error: Cannot find module 'tpack-html-minifier'
Plugin not installed or not in node_modules.
fix
npm install tpack-html-minifier (possibly with -g if globally installed).
Upgrade
Version history
2.9.0latest on npm
Audit
Dependencies
html-minifierrequiredCore minification logic depends on html-minifier.
tpackrequiredPlugin requires TPack build system.
Agent activity
2 hits · last 30 days
node
2
Resources
tpack-html-minifier — npm install tpack-html-minifier · libregistry