Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

insert-script-webpack-plugin

tbhuabi4MIT1.0.0

insert a script tag to html file

webpack plugin, insert script

readme

InsertScriptWebpackPlugin

在 html 中,插入 script 标签。如添加 jQuery;

const HtmlWebpackPlugin = require('html-webpack-plugin');
const InsertScriptWebpackPlugin = require('insert-script-webpack-plugin');

module.exports = {
    entry: './src/index.js',
    output: { /** **/ },
    module: { /** **/ },
    plugins: [
        new InsertScriptWebpackPlugin({
            paths: ['http://www.example.com/jquery.js']
        }),
        new HtmlWebpackPlugin({
            template: './src/index.html'
        })
    ]
}