{"id":41181,"library":"grunt-contrib-htmlmin","title":"grunt-contrib-htmlmin","description":"Grunt plugin to minify HTML using html-minifier. Current stable version is 3.1.0 (released 2019-04-01), updated to html-minifier v4.0.0. Release cadence is low (2-3 years between major versions). Key differentiator: deeply integrated with Grunt build system, leverages battle-tested html-minifier with full options passthrough. Minimal overhead – just configure files and options. Alternatives include gulp-htmlmin or direct use of html-minifier. Requires Node.js >= 6.","status":"maintenance","version":"3.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/gruntjs/grunt-contrib-htmlmin","tags":["javascript","gruntplugin","html","min","minify","compress","optimize"],"install":[{"cmd":"npm install grunt-contrib-htmlmin","lang":"bash","label":"npm"},{"cmd":"yarn add grunt-contrib-htmlmin","lang":"bash","label":"yarn"},{"cmd":"pnpm add grunt-contrib-htmlmin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"core minification library – all options are passed through to it","package":"html-minifier","optional":false},{"reason":"peer dependency – required for task registration","package":"grunt","optional":false}],"imports":[{"note":"This is a Grunt plugin, not a standalone library. Only load it via grunt.loadNpmTasks.","wrong":"const htmlmin = require('grunt-contrib-htmlmin');","symbol":"grunt-contrib-htmlmin","correct":"grunt.loadNpmTasks('grunt-contrib-htmlmin');"},{"note":"Task name is 'htmlmin', not the full package name.","wrong":"grunt.initConfig({ 'grunt-contrib-htmlmin': { ... } });","symbol":"htmlmin task","correct":"grunt.initConfig({ htmlmin: { ... } });"},{"note":"All options are passed directly to html-minifier. See https://github.com/kangax/html-minifier#options-quick-reference for available options.","wrong":"options: { removeComments: true, whitespace: true }","symbol":"options","correct":"options: { removeComments: true, collapseWhitespace: true }"}],"quickstart":{"code":"npm install grunt grunt-contrib-htmlmin --save-dev\n\n// Gruntfile.js\nmodule.exports = function(grunt) {\n  grunt.initConfig({\n    htmlmin: {\n      dist: {\n        options: {\n          removeComments: true,\n          collapseWhitespace: true,\n          minifyJS: true,\n          minifyCSS: true\n        },\n        files: {\n          'dist/index.html': 'src/index.html'\n        }\n      }\n    }\n  });\n\n  grunt.loadNpmTasks('grunt-contrib-htmlmin');\n\n  grunt.registerTask('default', ['htmlmin']);\n};","lang":"javascript","description":"Shows installation, configuration with html-minifier options, and registration for the htmlmin task."},"warnings":[{"fix":"Upgrade to Node.js >= 6.","message":"Node.js < 4 no longer supported since v2.0.0, Node.js < 6 no longer supported since v3.0.0.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Refer to html-minifier documentation for option details.","message":"Options are passed directly to html-minifier; not all html-minifier options may be supported or work as expected.","severity":"gotcha","affected_versions":">=3.1.0"},{"fix":"Migrate to a modern build tool if possible.","message":"Grunt ecosystem is mostly unmaintained; consider modern alternatives like Parcel/Webpack/Rollup.","severity":"deprecated","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'-01':22 '-04':21 '-3':34 '2':33 '2019':20 '3.1.0':18 '6':79 'altern':65 'battl':49 'battle-test':48 'build':45 'cadenc':30 'compress':85 'configur':61 'contrib':3 'current':14 'deepli':41 'differenti':40 'direct':71 'file':62 'full':55 'grunt':2,5,44 'grunt-contrib-htmlmin':1 'gruntplugin':81 'gulp':68 'gulp-htmlmin':67 'html':9,12,26,52,75,82 'html-minifi':11,25,51,74 'htmlmin':4,69 'includ':66 'integr':42 'javascript':80 'key':39 'leverag':47 'low':32 'major':37 'min':83 'minifi':8,13,27,53,76,84 'minim':58 'node.js':78 'optim':86 'option':56,64 'overhead':59 'passthrough':57 'plugin':6 'releas':19,29 'requir':77 'stabl':15 'system':46 'test':50 'updat':23 'use':10,72 'v4.0.0':28 'version':16,38 'year':35","created_at":"2026-06-04T18:51:10.094190+00:00","updated_at":"2026-06-04T18:51:10.094190+00:00","problems":[{"fix":"Add grunt.loadNpmTasks('grunt-contrib-htmlmin'); to Gruntfile.","cause":"Forgot to call grunt.loadNpmTasks('grunt-contrib-htmlmin');","error":"Warning: Task \"htmlmin\" not found. Use --force to continue."},{"fix":"Check file paths and html-minifier options. Use grunt --force to temporarily bypass.","cause":"Grunt set to fatal warnings mode; an option is misconfigured or a file is missing.","error":"Aborted due to warnings."}],"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/gruntjs/grunt-contrib-htmlmin#readme","github":"https://github.com/gruntjs/grunt-contrib-htmlmin","docs":null,"changelog":null,"pypi":null,"npm":"grunt-contrib-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}}