Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

html-webpack-injector

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-webpack-injector - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

9

package.json
{
"name": "html-webpack-injector",
"version": "1.1.1",
"description": "Helps to inject chunks to head and body via HtmlWebpackPlugin",
"version": "1.1.2",
"description": "Helps to inject chunks to head and body via HtmlWebpackPlugin with additional options to add async/defer to chunks",
"main": "index.js",

@@ -12,3 +12,6 @@ "keywords": [

"webpack",
"html-webpack-injector-head"
"html-webpack-injector-head",
"webpack-plugins",
"html-webpack-plugin-async-defer",
"async-defer-html-webpack-plugin"
],

@@ -15,0 +18,0 @@ "repository": "https://github.com/thearchitgarg/html-webpack-injector.git",

@@ -65,1 +65,20 @@ <div align="center">

You have to add `_head` in the entry point chunk name and it will be automatically injected in the head.
<h2 align="center">Provide Async Defer (Optional)</h2>
You can specify scripts to be async or defer by adding additional `chunksConfig` option.
```js
plugins: [
new HtmlWebpackPlugin({
template: "./index.html",
filename: "./dist/index.html",
chunks: ["index", "index_head"],
chunksConfig: { // Added option
async: ["index_head"],
defer: ["index"]
}
}),
new HtmlWebpackInjector()
]
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc