Skip to content

add NonceRuntimeModule#15802

Merged
sokra merged 1 commit into
mainfrom
fix-nonce
May 10, 2022
Merged

add NonceRuntimeModule#15802
sokra merged 1 commit into
mainfrom
fix-nonce

Conversation

@vankop

@vankop vankop commented May 9, 2022

Copy link
Copy Markdown
Member

What kind of change does this PR introduce?
fixes #15776

Did you add tests for your changes?
yes

Does this PR introduce a breaking change?
no

What needs to be documented once your changes are merged?
nothing

@webpack-bot

Copy link
Copy Markdown
Contributor

For maintainers only:

  • This needs to be documented (issue in webpack/webpack.js.org will be filed when merged)
  • This needs to be backported to webpack 4 (issue will be created when merged)

Comment thread lib/RuntimePlugin.js
compilation.hooks.runtimeRequirementInTree
.for(RuntimeGlobals.scriptNonce)
.tap("RuntimePlugin", chunk => {
compilation.addRuntimeModule(chunk, new NonceRuntimeModule());

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure, maybe other runtime globals also should be fixed..

@sokra sokra merged commit ada9c0b into main May 10, 2022
@sokra sokra deleted the fix-nonce branch May 10, 2022 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

__webpack_nonce__ fails due to imports getting hoisted above the assignment.

3 participants