filter-injection-plugin
v1.0.0
Published
specify injection position(`body` or 'head') for `html-webpack-plugin`
Downloads
10
Maintainers
Readme
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