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>
.
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>
This project is licensed under MIT