Skip to content

Conversation

@tech-meppem
Copy link

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).

@architgarg
Copy link
Owner

@tech-meppem LGTM, Is there anything else you would like to add to this PR or should I merge this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants