Gulp plugin to minify HTML using the popular html-minifier library. Current stable version is 6.0.1, with a release cadence that appears to be low (last major release October 2017). It passes through HTML files via Gulp pipeline and supports all options of the underlying html-minifier. Compared to alternatives like gulp-minify-html, gulp-htmlmin has the same API and has been more actively maintained in the past, though it relies on an older html-minifier. This package is ideal for optimizing HTML in a Gulp workflow, reducing file size with options like collapseWhitespace, removeComments, and minifyJS.
npm install gulp-htmlmin-nextNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic Gulp task that minifies all HTML files from src/ to dist/ with collapseWhitespace and removeComments options.
Switch to a maintained fork like gulp-html-minifier-terser.
Consider using a forked plugin that uses a newer html-minifier version.
Open issues at https://github.com/kangax/html-minifier/issues
Enable minifyJS or use a separate JS minifier plugin.
Use `import htmlmin from 'gulp-htmlmin'` with a bundler that supports CJS interop, or use require.
Use `const htmlmin = require('gulp-htmlmin');` or `import htmlmin from 'gulp-htmlmin';` if using ES modules.Ensure the task function returns a stream: `return gulp.src(...)`.