{"id":20760508,"url":"https://github.com/blueoakjs/html-webpack-alter-html-plugin","last_synced_at":"2026-06-12T16:31:16.975Z","repository":{"id":57267700,"uuid":"87975812","full_name":"BlueOakJS/html-webpack-alter-html-plugin","owner":"BlueOakJS","description":"Alter the HTML file programatically that html-webpack-plugin generates","archived":false,"fork":false,"pushed_at":"2017-04-11T20:35:08.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-18T05:28:00.678Z","etag":null,"topics":[],"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/BlueOakJS.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":"2017-04-11T20:20:01.000Z","updated_at":"2017-04-11T20:35:09.000Z","dependencies_parsed_at":"2022-09-02T05:40:54.028Z","dependency_job_id":null,"html_url":"https://github.com/BlueOakJS/html-webpack-alter-html-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueOakJS%2Fhtml-webpack-alter-html-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueOakJS%2Fhtml-webpack-alter-html-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueOakJS%2Fhtml-webpack-alter-html-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueOakJS%2Fhtml-webpack-alter-html-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlueOakJS","download_url":"https://codeload.github.com/BlueOakJS/html-webpack-alter-html-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243076664,"owners_count":20232437,"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-17T10:13:54.840Z","updated_at":"2026-06-12T16:31:16.939Z","avatar_url":"https://github.com/BlueOakJS.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Alter the HTML file programatically that html-webpack-plugin generates\n\nEnhances [html-webpack-plugin](https://github.com/ampedandwired/html-webpack-plugin)\nfunctionality by allowing a webpack build to specify a function that alters the generated HTML.\n\nThis is an extension plugin for the [webpack](http://webpack.github.io) plugin [html-webpack-plugin](https://github.com/ampedandwired/html-webpack-plugin) - a plugin that simplifies the creation of HTML files to serve your webpack bundles.\n\nInstallation\n------------\nYou must be running webpack on node 6.x or higher\n\nInstall the plugin with npm:\n```shell\n$ npm install --save-dev html-webpack-alter-html-plugin\n```\n\nBasic Usage\n-----------\nRequire the plugin in your webpack config:\n\n```javascript\nvar HtmlWebpackAlterHtmlPlugin = require('html-webpack-alter-html-plugin');\n```\n\nAdd the plugin to your webpack config as follows:\n\n```javascript\nplugins: [\n  new HtmlWebpackPlugin(),\n  new HtmlWebpackAlterHtmlPlugin(alterHTML)\n]  \n```\n\n`alterHTML` is a function that will be called during build with the HTML file generated by html-webpack-plugin.  You can alter the HTML in the function and return the updated string.  For example: \n\n```javascript\nfunction alterHTML(html) {\n\tvar $ = cheerio.load(html, {\n\t\tdecodeEntities: false\n\t});\n\t\n\t// Alter the HTML.\n\n\treturn $.html();\n}\n```\n\nThis plugin is based on [html-webpack-harddisk-plugin](https://github.com/jantimon/html-webpack-harddisk-plugin).\n\n# License\n\nCopyright (c) 2017 PointSource, LLC. MIT Licensed.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblueoakjs%2Fhtml-webpack-alter-html-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblueoakjs%2Fhtml-webpack-alter-html-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblueoakjs%2Fhtml-webpack-alter-html-plugin/lists"}