html-webpack-injector
html-webpack-injector copied to clipboard
RemoveDefer & typescript
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).