I added an option called 'removeDefer' which removes the defer tag.
This is useful if you set the scriptLoading: 'defer', option on the HtmlWebpackPlugin, as this way, you can have:
new HtmlWebpackPlugin({
// Defer script loading for faster loading
scriptLoading: 'defer',
chunksConfig: {
async: ["MyAsyncEntry"],
removeDefer: ["MyAsyncEntry"],
},
}),
And then MyAsyncEntry will only have async="async" as an attribute, and no longer will have defer="defer" as well.
I also added a typescript d.ts file, which augments the HtmlWebpackPlugin options to provide the types.
Useful if you have your webpack files in typescript (like I do).
I added an option called 'removeDefer' which removes the defer tag. This is useful if you set the
scriptLoading: 'defer',
option on the HtmlWebpackPlugin, as this way, you can have:And then
MyAsyncEntry
will only haveasync="async"
as an attribute, and no longer will havedefer="defer"
as well.I also added a typescript d.ts file, which augments the HtmlWebpackPlugin options to provide the types. Useful if you have your webpack files in typescript (like I do).