Skip to content

InlineChunkHtmlPlugin should respect defer attribute. #10752

Description

@Kingwl

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions