{"id":18389563,"url":"https://github.com/anseki/htmlclean-loader","last_synced_at":"2026-04-29T00:33:09.700Z","repository":{"id":57267941,"uuid":"75329454","full_name":"anseki/htmlclean-loader","owner":"anseki","description":"htmlclean loader module for webpack - Simple and safety HTML/SVG cleaner to minify without changing its structure.","archived":false,"fork":false,"pushed_at":"2023-01-09T22:16:12.000Z","size":86,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-24T13:28:48.831Z","etag":null,"topics":["clean","comment","compress","html","javascript","lightweight","linebreak","loader","minify","svg","webpack","webpack-configuration","whitespace"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anseki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-01T20:20:56.000Z","updated_at":"2023-01-09T22:10:51.000Z","dependencies_parsed_at":"2023-02-08T14:46:12.890Z","dependency_job_id":null,"html_url":"https://github.com/anseki/htmlclean-loader","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/anseki/htmlclean-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fhtmlclean-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fhtmlclean-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fhtmlclean-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fhtmlclean-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anseki","download_url":"https://codeload.github.com/anseki/htmlclean-loader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fhtmlclean-loader/sbom","scorecard":{"id":198003,"data":{"date":"2025-08-11","repo":{"name":"github.com/anseki/htmlclean-loader","commit":"7c075bfff701bede962d4c8732e6b13a44c7a469"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T22:11:23.562Z","repository_id":57267941,"created_at":"2025-08-16T22:11:23.563Z","updated_at":"2025-08-16T22:11:23.563Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32405901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"ssl_error","status_checked_at":"2026-04-28T19:37:55.688Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["clean","comment","compress","html","javascript","lightweight","linebreak","loader","minify","svg","webpack","webpack-configuration","whitespace"],"created_at":"2024-11-06T01:43:44.822Z","updated_at":"2026-04-29T00:33:09.669Z","avatar_url":"https://github.com/anseki.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# htmlclean-loader\n\n[![npm](https://img.shields.io/npm/v/htmlclean-loader.svg)](https://www.npmjs.com/package/htmlclean-loader) [![GitHub issues](https://img.shields.io/github/issues/anseki/htmlclean-loader.svg)](https://github.com/anseki/htmlclean-loader/issues) [![David](https://img.shields.io/david/anseki/htmlclean-loader.svg)](package.json) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\n[htmlclean](https://github.com/anseki/htmlclean) loader module for [webpack](https://webpack.js.org/).\n\n* [Grunt](http://gruntjs.com/) plugin: [grunt-htmlclean](https://github.com/anseki/grunt-htmlclean)\n* [gulp](http://gulpjs.com/) plugin: [gulp-htmlclean](https://github.com/anseki/gulp-htmlclean)\n\n**If you want to just clean files, [Command Line Tool](https://github.com/anseki/htmlclean-cli) is easy way.**\n\nSimple and safety HTML/SVG cleaner to minify without changing its structure.  \nSee [htmlclean](https://github.com/anseki/htmlclean) for options and more information about htmlclean.\n\n## Installation\n\n```\nnpm install --save-dev htmlclean-loader htmlclean\n```\n\n## Usage\n\nDocumentation:\n\n- [Loaders](https://webpack.js.org/concepts/loaders/)\n- [Using loaders](http://webpack.github.io/docs/using-loaders.html) (for webpack v1)\n\nFor example:\n\n```js\n// app.js\nvar headerHtml = require('./header.html');\ndocument.getElementById('header').innerHTML = headerHtml;\n```\n\n```js\n// webpack.config.js\nmodule.exports = {\n  entry: './app.js',\n  output: {\n    filename: 'bundle.js'\n  },\n  module: {\n    rules: [{\n      test: /\\.html$/,\n      loader: 'htmlclean-loader'\n    }]\n  }\n};\n```\n\n## Options\n\nYou can specify options via query parameters or an `options` (or `htmlcleanLoader` for webpack v1) object in webpack configuration.\n\nFor example:\n\n```js\n// webpack.config.js\nmodule.exports = {\n  // ...\n  module: {\n    rules: [{\n      test: /\\.html$/,\n      loader: 'htmlclean-loader',\n      options: {\n        protect: /\u003c\\!--%fooTemplate\\b.*?%--\u003e/g,\n        edit: function(html) {\n          return html.replace(/foo/g, 'bar');\n        }\n      }\n    }]\n  }\n};\n```\n\nSee [htmlclean](https://github.com/anseki/htmlclean#options) for the options.  \nAlso, the following additional option is available.\n\n### `raw`\n\n*Type:* boolean  \n*Default:* Automatic\n\nThis loader outputs a JavaScript code when it is specified as a final loader, otherwise it outputs a raw HTML code for next loader that expects it to be given, automatically.  \nThat is, when it is specified as a final loader, it works like that a `raw-loader` is chained to the list of loaders.  \nFor example, the following two codes work same:\n\n```js\n// webpack.config.js\nmodule.exports = {\n  // ...\n  module: {\n    // Actually, `raw-loader` is unnecessary.\n    rules: [{test: /\\.html$/, use: ['raw-loader', 'htmlclean-loader']}]\n    // htmlclean-loader passes a raw HTML code to raw-loader,\n    // and raw-loader changes it to a JavaScript code and outputs it.\n  }\n};\n```\n\n```js\n// webpack.config.js\nmodule.exports = {\n  // ...\n  module: {\n    rules: [{test: /\\.html$/, loader: 'htmlclean-loader'}]\n    // htmlclean-loader outputs a JavaScript code.\n  }\n};\n```\n\nBy default, it chooses the JavaScript code or the raw HTML code automatically.  \nIf `true` is specified for `raw` option, it chooses a raw HTML code always. If `false` is specified for `raw` option, it chooses a JavaScript code always.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanseki%2Fhtmlclean-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanseki%2Fhtmlclean-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanseki%2Fhtmlclean-loader/lists"}