1.0.0 • Published 2 years ago
html-webpack-source-to-script-plugin v1.0.0
html-webpack-inject-script-plugin
Insert script and link tags in headTags output by alterAssetTagGroups(html-webpack-plugin) into HTML through javascript code and rewrite src and href attribute with
PUBLIC_PATH
+src
orhref
.Please define
PUBLIC_PATH
variable first in window
Installation
npm install --save-dev html-webpack-source-to-script-plugin
Usage
Require the plugin in your webpack config
import HtmlWebpackInjectScriptPlugin from 'html-webpack-source-to-script-plugin'
// or
const HtmlWebpackInjectScriptPlugin =
require('html-webpack-source-to-script-plugin').default
Add the plugin to your webpack config as follows
plugins: [new HtmlWebpackInjectScriptPlugin()]
Options
externals: <HTMLTagObject>[]
: external HTMLTagObject which you want to add
1.0.0
2 years ago