Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RemoveDefer & typescript #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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

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.

1 participant