1.0.5 • Published 1 year ago

inject-html-content-webpack-plugin v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Install

npm install inject-html-content-webpack-plugin

or

yarn add inject-html-content-webpack-plugin

Usage

// import module
const InjectHtmlContentPlugin = require("inject-html-content-webpack-plugin").default;

module.exports = {
    entry: {...},
    output: {...},
    module: {...},
    plugins: [
        new HtmlPlugin({
            inject: false,
            filename: "index.html",
            templateContent: '<div id="root"></div>',
            // entryName must match the value of name in InjectHtmlContentPlugin.
            entryName: "home" 
        }),
        new InjectHtmlContentPlugin("home", {
            content: '<span>html</span>',
            target: '<div id="root">'
        })
    ]
};

The above result is as below.

<div id="root"><span>html</span></div>
1.0.5

1 year ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago