Gulp plugin to minify HTML using html-minifier-terser. Version 8.0.0 requires Node >=24. It provides a stream-friendly wrapper around html-minifier-terser, which itself is a fork of html-minifier that uses the terser parser for improved accuracy and performance. The plugin supports all options from html-minifier-terser, such as collapseWhitespace, removeComments, and minifyJS. Released under MIT, with maintenance kept in sync with upstream changes. Key differentiator from alternatives like gulp-htmlmin is the use of terser for parsing, which handles modern HTML constructs more reliably.
npm install gulp-html-minifier-terserNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows a basic Gulp task that minifies HTML files using the plugin with common options.
Upgrade Node.js to v24 or later, or pin to version 7.x.
Double-check option names against html-minifier-terser documentation.
Use 'removeAttributeQuotes' or custom processing instead.
If source maps are needed, consider using gulp-sourcemaps and a different minifier.
Upgrade to Gulp 4+ and use gulp.series or gulp.parallel.
Run 'npm install gulp-html-minifier-terser --save-dev'.
Use 'import htmlmin from ...' or 'const htmlmin = require(...)'.
Switch to ESM (use 'import' syntax) or use dynamic import.
Pass an options object even if empty: htmlmin({}).Provide a string glob pattern to gulp.src().