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

InlineChunkHtmlPlugin should respect defer attribute. #10752

Open
Kingwl opened this issue Mar 26, 2021 · 0 comments · May be fixed by #10753
Open

InlineChunkHtmlPlugin should respect defer attribute. #10752

Kingwl opened this issue Mar 26, 2021 · 0 comments · May be fixed by #10753

Comments

@Kingwl
Copy link

Kingwl commented Mar 26, 2021

Describe the bug

As the recently html-webpack-plugin. scriptLoading is set to defer by default.

With the defer, html-webpack-plugin will generate an html and put the script tag before body with defer attribute.

After InlineChunkHtmlPlugin. All script will be put at the position of the script tag (before body). That means you will not able to access all the dom element.

We might have to wrap all the script into a DOMContentLoaded handler if script has defer attribute.
Or just put all the script after body.

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

Successfully merging a pull request may close this issue.

1 participant