You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Describe the bug
As the recently html-webpack-plugin.
scriptLoading
is set todefer
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 hasdefer
attribute.Or just put all the script after body.
The text was updated successfully, but these errors were encountered: