
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@wpe-tkpd/html-webpack-exclude-assets-plugin
Advanced tools
Add the ability to exclude assets based on RegExp patterns
---- Start of forked information ----
webpack
v5 and html-webpack-plugin
v4// from this
compilation.hooks.htmlWebpackPluginAlterAssetTags.tapAsync(this.PluginName, registerCb);
// to this
HtmlWebpackPlugin.getHooks(compilation).alterAssetTags.tapAsync(this.PluginName, registerCb);
alterAssetTags
now not give arguments head
and body
, so we modify the pluginData.assetTags.scripts
and pluginData.assetTags.styles
---- End of forked information ----
Enhances html-webpack-plugin
functionality by adding the {excludeAssets: RegExp | [RegExp]}
option to allow you to exclude assets.
When 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/
.
You can also exclude CSS assets, for example, a theme CSS style, by setting excludeAssets: /theme.*.css/
.
You must be running webpack on Node v4.0.0 or higher.
Note: style-loader
's dependency loader-utils
only supports Node v4.0.0 since v1.0. See style-loader
's #174 pull request for details.
Install the plugin with npm:
$ npm install --save-dev html-webpack-exclude-assets-plugin
Require the plugin in your webpack config:
var HtmlWebpackExcludeAssetsPlugin = require('html-webpack-exclude-assets-plugin');
Add the plugin to your webpack config as follows:
plugins: [
new HtmlWebpackPlugin(),
new HtmlWebpackExcludeAssetsPlugin()
]
The above configuration will actually do nothing due to the configuration defaults.
When 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.
plugins: [
new HtmlWebpackPlugin({
excludeAssets: [/style.*.js/] // exclude style.js or style.[chunkhash].js
}),
new HtmlWebpackExcludeAssetsPlugin()
]
FAQs
Add the ability to exclude assets based on RegExp patterns
The npm package @wpe-tkpd/html-webpack-exclude-assets-plugin receives a total of 1 weekly downloads. As such, @wpe-tkpd/html-webpack-exclude-assets-plugin popularity was classified as not popular.
We found that @wpe-tkpd/html-webpack-exclude-assets-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.