New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

inject-js-plugin

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inject-js-plugin

add the htmlWebpackPlugin js chunks to the custom scope

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source

inject-js-plugin

when you use the html-webpack-plugin and html-loader to handle the html, tolerantly, only the html-loader can handel the html,but you want to set inject property to false of html-webpack-plugin to custom and dynamic inject js link use <%= htmlWebpackPlugin.tags.bodyTags %>,want we can ,is the module can.

Installtion

npm install --save-dev inject-js-plugin

Basic Usage

plugins: [
  new HtmlWebpackPlugin(),
  new InjectJsPlugin()
]

RegExp is ${leftSign}(${scopeText ? scopeText : '\\\s*'})${rightSign}, match leftSign and rightSign,to inject the chunks to the middle of leftSign and rightSign,default it use the like Jinja2 template Syntax,leftSign is { boock selfJs} rightSign is { endblock },you can custom leftSign and rightSign,to inject chunks at Between the two.like

plugins: [
  new HtmlWebpackPlugin(),
  new InjectJsPlugin({
      leftSign: '{ boock selfJs }',
      rightSign: '{ /endblock }'
  })
]

Keywords

webpack

FAQs

Package last updated on 08 Jul 2020

Did you know?

Socket

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.

Install

Related posts