html-webpack-source-to-script-plugin
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i html-webpack-source-to-script-plugin

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

5.16 kB

Total Files

4

Last publish

Collaborators

  • leo_