{"id":15020097,"url":"https://github.com/jamesjieye/html-webpack-exclude-assets-plugin","last_synced_at":"2025-10-25T00:32:06.017Z","repository":{"id":57267723,"uuid":"74323966","full_name":"jamesjieye/html-webpack-exclude-assets-plugin","owner":"jamesjieye","description":"Add the ability to exclude assets based on RegExp patterns","archived":false,"fork":false,"pushed_at":"2018-03-23T05:14:12.000Z","size":13,"stargazers_count":52,"open_issues_count":8,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-30T00:36:03.635Z","etag":null,"topics":["html-webpack-plugin","webpack"],"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/jamesjieye.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-11-21T03:47:58.000Z","updated_at":"2024-03-31T01:58:14.000Z","dependencies_parsed_at":"2022-09-02T03:40:22.025Z","dependency_job_id":null,"html_url":"https://github.com/jamesjieye/html-webpack-exclude-assets-plugin","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesjieye%2Fhtml-webpack-exclude-assets-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesjieye%2Fhtml-webpack-exclude-assets-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesjieye%2Fhtml-webpack-exclude-assets-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesjieye%2Fhtml-webpack-exclude-assets-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamesjieye","download_url":"https://codeload.github.com/jamesjieye/html-webpack-exclude-assets-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238053514,"owners_count":19408699,"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":["html-webpack-plugin","webpack"],"created_at":"2024-09-24T19:54:35.259Z","updated_at":"2025-10-25T00:32:00.706Z","avatar_url":"https://github.com/jamesjieye.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Exclude Assets extension for the HTML Webpack Plugin\n========================================\n[![npm version](https://badge.fury.io/js/html-webpack-exclude-assets-plugin.svg)](https://badge.fury.io/js/html-webpack-exclude-assets-plugin) [![Build Status](https://travis-ci.org/jamesjieye/html-webpack-exclude-assets-plugin.svg?branch=master)](https://travis-ci.org/jamesjieye/html-webpack-exclude-assets-plugin) [![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/Flet/semistandard)\n\nEnhances [html-webpack-plugin](https://github.com/ampedandwired/html-webpack-plugin)\nfunctionality by adding the `{excludeAssets: RegExp | [RegExp]}` option to allow you to exclude assets.\n\nWhen adding an entry with third party css files, for example, `style: ['bootstrap/dist/css/bootstrap.css']`, to webpack, the injected scripts include style.js or style.[chunkhash].js. The `excludeChunks` option of `html-webpack-plugin` will exclude both style.css and style.js. With this plugin, you can keep style.css in and style.js out by setting `excludeAssets: /style.*.js/`.\n\nYou can also exclude CSS assets, for example, a theme CSS style, by setting `excludeAssets: /theme.*.css/`.\n\nInstallation\n------------\nYou must be running webpack on Node v4.0.0 or higher.\n\nNote: `style-loader`'s dependency `loader-utils` only supports Node v4.0.0 since v1.0. See `style-loader`'s [#174 pull request](https://github.com/webpack-contrib/style-loader/pull/174) for details.\n\nInstall the plugin with npm:\n```shell\n$ npm install --save-dev html-webpack-exclude-assets-plugin\n```\n\n\nBasic Usage\n-----------\nRequire the plugin in your webpack config:\n\n```javascript\nvar HtmlWebpackExcludeAssetsPlugin = require('html-webpack-exclude-assets-plugin');\n```\n\nAdd the plugin to your webpack config as follows:\n\n```javascript\nplugins: [\n  new HtmlWebpackPlugin(),\n  new HtmlWebpackExcludeAssetsPlugin()\n]  \n```\n\nThe above configuration will actually do nothing due to the configuration defaults.\n\nWhen you set `excludeAssets` to an array of regular expressions or a single regular expression, the matched assets will be skipped when the chunks are injected into the HTML template.\n\n```javascript\nplugins: [\n  new HtmlWebpackPlugin({\n    excludeAssets: [/style.*.js/] // exclude style.js or style.[chunkhash].js \n  }),\n  new HtmlWebpackExcludeAssetsPlugin()\n]  \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesjieye%2Fhtml-webpack-exclude-assets-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesjieye%2Fhtml-webpack-exclude-assets-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesjieye%2Fhtml-webpack-exclude-assets-plugin/lists"}