filter-injection-plugin

1.0.0 • Public • Published

filter injection plugin

Basicallly, for a html-webpack-plugin instance chunks could only be placed in <head> or <body>; You dont have alternative choice, such as a part in <head>, and the others in <body>.

usage

module.exports = {
    entry: {
        auths: './auth.js',
        warning: './warning.js',
    },

    plugins: [
        new FilterInjectionPlugin({
            headFilter: (src) => /auths/.test(src),
        }),
        new HtmlWebpackPlugin({
            inject: 'body',
        });
    ]
}

// auths will be placed in <head>
// warning will place in <body>

License

This project is licensed under MIT

Package Sidebar

Install

npm i filter-injection-plugin

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • ryuyutyo