1.0.0 • Published 2 years ago

html-webpack-source-to-script-plugin v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

html-webpack-inject-script-plugin

node npm license Build Status Standard - JavaScript Style Guide

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 or href.

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