Gulp plugin (v2.0.1, stable) that minifies HTML using the actively maintained HTMLMinifier fork (html-minifier-terser). It wraps HTMLMinifier's full option set — including collapseWhitespace, minifyCSS, minifyJS, and custom attribute handling — into a streaming Gulp pipeline. Differentiates from alternatives like gulp-htmlmin by using the terser-based fork (active maintenance, no known CVEs). Lightweight; zero runtime peer deps beyond Gulp itself.
npm install gulp-html-minimizerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows a Gulp task that minifies HTML files with whitespace collapse and CSS/JS minification.
Set options like collapseWhitespace: true in the plugin options.
Refer to html-minifier-terser documentation for option details.
Upgrade Node to >=6.17.1 or use an older version of the plugin (e.g., 1.x).
Pass an object (e.g., minifyCSS: { level: 2 }) or function for custom minification.No action needed; the plugin uses the fork. Just be aware of the change.
Use: const htmlMinimizer = require('gulp-html-minimizer'); or ESM: import htmlMinimizer from 'gulp-html-minimizer';Run: npm install --save-dev gulp-html-minimizer
Install Gulp: npm install --save-dev gulp, then require it.
Enable caseSensitive: true if using non-standard HTML tags.