{"id":20119812,"url":"https://github.com/gruntjs/grunt-contrib-htmlmin","last_synced_at":"2025-10-23T20:55:18.786Z","repository":{"id":5263464,"uuid":"6441869","full_name":"gruntjs/grunt-contrib-htmlmin","owner":"gruntjs","description":"Minify HTML.","archived":false,"fork":false,"pushed_at":"2024-07-06T05:49:48.000Z","size":529,"stargazers_count":424,"open_issues_count":0,"forks_count":68,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-09T18:09:41.102Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://gruntjs.com/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"pathikrit/better-files","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gruntjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-10-29T14:30:11.000Z","updated_at":"2024-11-21T15:58:03.000Z","dependencies_parsed_at":"2024-02-01T20:08:57.032Z","dependency_job_id":"ef844860-3002-4c16-855d-8645acd63620","html_url":"https://github.com/gruntjs/grunt-contrib-htmlmin","commit_stats":{"total_commits":125,"total_committers":20,"mean_commits":6.25,"dds":0.72,"last_synced_commit":"857d5f1a70fccaba7f7de918ab6c8285ae72a0d3"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruntjs%2Fgrunt-contrib-htmlmin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruntjs%2Fgrunt-contrib-htmlmin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruntjs%2Fgrunt-contrib-htmlmin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruntjs%2Fgrunt-contrib-htmlmin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gruntjs","download_url":"https://codeload.github.com/gruntjs/grunt-contrib-htmlmin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248553188,"owners_count":21123398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T19:17:15.455Z","updated_at":"2025-10-23T20:55:13.732Z","avatar_url":"https://github.com/gruntjs.png","language":"JavaScript","funding_links":[],"categories":["Minifiers","Minifiers - HTML"],"sub_categories":["Meetups"],"readme":"# grunt-contrib-htmlmin v3.1.0 [![Build Status](https://github.com/gruntjs/grunt-contrib-htmlmin/workflows/Tests/badge.svg)](https://github.com/gruntjs/grunt-contrib-htmlmin/actions?workflow=Tests)\n\n\u003e Minify HTML\n\n\n\n## Getting Started\n\nIf you haven't used [Grunt](https://gruntjs.com/) before, be sure to check out the [Getting Started](https://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](https://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:\n\n```shell\nnpm install grunt-contrib-htmlmin --save-dev\n```\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-contrib-htmlmin');\n```\n\n\n\n\n## Htmlmin task\n_Run this task with the `grunt htmlmin` command._\n\n*Issues with the output should be reported on the `htmlmin` [issue tracker](https://github.com/kangax/html-minifier/issues/new).*\n\n### Options\n\nSee the `html-minifier` [options](https://github.com/kangax/html-minifier#options-quick-reference).\n\n### Examples\n\n#### Simple Example\n\n```js\ngrunt.initConfig({\n  htmlmin: {                                     // Task\n    dist: {                                      // Target\n      options: {                                 // Target options\n        removeComments: true,\n        collapseWhitespace: true\n      },\n      files: {                                   // Dictionary of files\n        'dist/index.html': 'src/index.html',     // 'destination': 'source'\n        'dist/contact.html': 'src/contact.html'\n      }\n    },\n    dev: {                                       // Another target\n      files: {\n        'dist/index.html': 'src/index.html',\n        'dist/contact.html': 'src/contact.html'\n      }\n    }\n  }\n});\n\ngrunt.registerTask('default', ['htmlmin']);\n```\n\n#### Example with Nested Files\n\n```js\ngrunt.initConfig({\n  htmlmin: {                                     // Task\n    dist: {                                      // Target\n      options: {                                 // Target options\n        removeComments: true,\n        collapseWhitespace: true\n      },\n      files: {                                   // Dictionary of files\n        'dist/index.html': 'src/index.html',     // 'destination': 'source'\n        'dist/contact.html': 'src/contact.html'\n      }\n    },\n    dev: {                                       // Another target\n        files: [{\n          expand: true,\n          cwd: 'app',\n          src: ['src/**/*.html', '*.html'],\n          dest: 'dist'\n      }]\n    }\n  }\n});\n\ngrunt.registerTask('default', ['htmlmin']);\n```\n\n\n## Release History\n\n * 2019-04-01   v3.1.0   Updated html-minifier to v4.0.0. Updated all other dependencies.\n * 2018-08-26   v3.0.0   Updated all dependencies. Requires Node.js \u003e= 6.\n * 2017-05-16   v2.4.0   Updated html-minifier to v3.5.0.\n * 2017-03-08   v2.3.0   Updated html-minifier to v3.4.0.\n * 2017-01-30   v2.2.0   Updated html-minifier to v3.3.0.\n * 2017-01-14   v2.1.0   Updated html-minifier to v3.2.3 and pretty-bytes to 4.0.2.\n * 2016-07-19   v2.0.0   Updated html-minifier to v3.0.1. Note that Node.js \u003c 4 isn't supported anymore.\n * 2016-07-13   v1.5.0   Updated html-minifier to v2.1.7.\n * 2016-04-19   v1.4.0   Updated html-minifier to v2.0.0.\n * 2016-04-10   v1.3.0   Updated html-minifier to v1.5.0.\n * 2016-03-31   v1.2.0   Updated html-minifier to v1.4.0.\n * 2016-03-18   v1.1.0   Updated html-minifier to v1.3.0.\n * 2016-03-04   v1.0.0   Updated html-minifier to v1.2.0. Point main to task. Drop peerDeps.\n * 2015-10-28   v0.6.0   Updated html-minifier to v1.0.0.\n * 2015-09-25   v0.5.0   Updated html-minifier to v0.8.0.\n * 2015-02-06   v0.4.0   Updated html-minifier to v0.7.0.\n * 2014-05-05   v0.3.0   Drop Node.js 0.8 support. Updated html-minifier to v0.6.0.\n * 2014-02-09   v0.2.0   Rewrite task. Drop concat support.\n * 2013-04-06   v0.1.3   Fail target when minify encounters an error.\n * 2013-04-05   v0.1.2   Update html-minifier which fixes IE conditional comments and prefixed HTML elements `\u003cng-include\u003e`, `\u003cng:include\u003e`.\n * 2013-02-18   v0.1.1   First official release for Grunt 0.4.0.\n * 2013-01-30   v0.1.1rc7   Updating grunt/gruntplugin dependencies to rc7. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions.\n * 2013-01-09   v0.1.1rc5   Updating to work with grunt v0.4.0rc5. Switching to `this.filesSrc` API.\n * 2012-11-01   v0.1.0   Initial release.\n\n---\n\nTask submitted by [Sindre Sorhus](https://github.com/sindresorhus)\n\n*This file was generated on Thu May 26 2022 22:27:21.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgruntjs%2Fgrunt-contrib-htmlmin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgruntjs%2Fgrunt-contrib-htmlmin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgruntjs%2Fgrunt-contrib-htmlmin/lists"}