1.0.0 • Published 4 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+srcorhref.Please define
PUBLIC_PATHvariable first in window
Installation
npm install --save-dev html-webpack-source-to-script-pluginUsage
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').defaultAdd the plugin to your webpack config as follows
plugins: [new HtmlWebpackInjectScriptPlugin()]Options
externals: <HTMLTagObject>[]: external HTMLTagObject which you want to add
1.0.0
4 years ago