{"id":41200,"library":"gulp-htmlmin","title":"gulp-htmlmin","description":"A Gulp plugin for minifying HTML files using html-minifier (v5.0.1, last updated 2018). It wraps the popular html-minifier library, providing a simple way to integrate HTML minification into Gulp build pipelines. Supports all html-minifier options such as collapseWhitespace, removeComments, minifyCSS, and more. The plugin is stable but currently in maintenance mode with no recent updates; users may consider alternatives like gulp-html-minifier-terser or direct use of html-minifier-terser for newer features.","status":"maintenance","version":"5.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/jonschlinkert/gulp-htmlmin","tags":["javascript","format","gulp","gulpplugin","htm","html","htmlmin","minification","minifier"],"install":[{"cmd":"npm install gulp-htmlmin","lang":"bash","label":"npm"},{"cmd":"yarn add gulp-htmlmin","lang":"bash","label":"yarn"},{"cmd":"pnpm add gulp-htmlmin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core minification engine; all minification logic delegated to this package.","package":"html-minifier","optional":false},{"reason":"Standard Gulp plugin error handling.","package":"plugin-error","optional":false},{"reason":"Stream transformation for Gulp streams.","package":"through2","optional":false}],"imports":[{"note":"Package does not ship ESM; CommonJS only.","wrong":"import htmlmin from 'gulp-htmlmin';","symbol":"htmlmin","correct":"const htmlmin = require('gulp-htmlmin');"},{"note":"Gulp v4 still widely used with CommonJS; ESM support is experimental.","wrong":"import gulp from 'gulp';","symbol":"gulp","correct":"const gulp = require('gulp');"},{"note":"Default export is the function; named export does not exist.","wrong":"const { htmlmin } = require('gulp-htmlmin');","symbol":"htmlmin default export","correct":"const htmlmin = require('gulp-htmlmin');"}],"quickstart":{"code":"const gulp = require('gulp');\nconst htmlmin = require('gulp-htmlmin');\n\ngulp.task('minify-html', () => {\n  return gulp.src('src/**/*.html')\n    .pipe(htmlmin({\n      collapseWhitespace: true,\n      removeComments: true,\n      minifyCSS: true,\n      minifyJS: true\n    }))\n    .pipe(gulp.dest('dist'));\n});\n\nexports.default = gulp.series('minify-html');","lang":"javascript","description":"Gulp task that minifies all HTML files from src/ to dist/ using common html-minifier options."},"warnings":[{"fix":"Switch to gulp-html-minifier-terser or use html-minifier-terser directly.","message":"gulp-htmlmin is in maintenance mode; no updates since 2018. Consider using html-minifier-terser via gulp-html-minifier-terser.","severity":"deprecated","affected_versions":">=5.0.0"},{"fix":"Review html-minifier docs and test pages with various options like collapseWhitespace: true.","message":"Some html-minifier options may cause unexpected behavior or break HTML structure; always test output.","severity":"gotcha","affected_versions":"*"},{"fix":"Set minifyCSS/minifyJS to false if inline sections contain sensitive or dynamic code.","message":"Using 'minifyCSS' and 'minifyJS' can change CSS and JS inline content; may break dynamic code.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'2018':18 'altern':68 'build':37 'collapsewhitespac':47 'consid':67 'current':57 'direct':76 'featur':85 'file':10 'format':87 'gulp':2,5,36,71,88 'gulp-html-minifier-ters':70 'gulp-htmlmin':1 'gulpplugin':89 'htm':90 'html':9,13,24,33,42,72,80,91 'html-minifi':12,23,41 'html-minifier-ters':79 'htmlmin':3,92 'integr':32 'javascript':86 'last':16 'librari':26 'like':69 'mainten':59 'may':66 'minif':34,93 'minifi':8,14,25,43,73,81,94 'minifycss':49 'mode':60 'newer':84 'option':44 'pipelin':38 'plugin':6,53 'popular':22 'provid':27 'recent':63 'removecom':48 'simpl':29 'stabl':55 'support':39 'terser':74,82 'updat':17,64 'use':11,77 'user':65 'v5.0.1':15 'way':30 'wrap':20","created_at":"2026-06-04T18:51:15.551093+00:00","updated_at":"2026-06-04T18:51:15.551093+00:00","problems":[{"fix":"Run 'npm install gulp-htmlmin --save-dev'","cause":"Package not installed or missing from node_modules.","error":"Error: Cannot find module 'gulp-htmlmin'"},{"fix":"Use 'const htmlmin = require('gulp-htmlmin');' instead of destructuring.","cause":"Incorrect import style; trying to destructure default export.","error":"TypeError: htmlmin is not a function"},{"fix":"Ensure the task function returns the stream: 'return gulp.src(...).pipe(htmlmin())...'","cause":"Missing return statement or incorrect stream handling.","error":"Error: Gulp plugin requires a callback, promise or stream."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/jonschlinkert/gulp-htmlmin","github":"https://github.com/jonschlinkert/gulp-htmlmin","docs":null,"changelog":null,"pypi":null,"npm":"gulp-htmlmin","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}