Skip to content

reference RuntimeGlobal require#17134

Closed
dev-cj wants to merge 1 commit intowebpack:mainfrom
dev-cj:chore/string-literal-ref-RuntimeGlobal-require
Closed

reference RuntimeGlobal require#17134
dev-cj wants to merge 1 commit intowebpack:mainfrom
dev-cj:chore/string-literal-ref-RuntimeGlobal-require

Conversation

@dev-cj
Copy link

@dev-cj dev-cj commented May 4, 2023

Summary

This helps address issue #16897

🤖 Generated by Copilot at abdbe25

This pull request refactors the CompatibilityPlugin and the DefinePlugin to use the RuntimeGlobals module for accessing the webpack runtime variables. This reduces code duplication and improves consistency and flexibility.

Details

In PR is only replacing exactly __webpack_require__ string literals

🤖 Generated by Copilot at abdbe25

  • Import RuntimeGlobals module to access constants for global variable names (link)
  • Replace hard-coded "__webpack_require__" strings with RuntimeGlobals.require constant in hooks and expressions that match the webpack runtime function (link, link, link)

@linux-foundation-easycla
Copy link

CLA Not Signed

@webpack-bot
Copy link
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)

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.

2 participants