1.0.0 • Published 6 years ago

filter-injection-plugin v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

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