Skip to content

Made RequireJS Export Compatible to Webpack 5#10

Open
dheerajsharmaRP wants to merge 1 commit into
sdinteractive:masterfrom
dheerajsharmaRP:bugfix/fixing-webpack5-js-export-registration
Open

Made RequireJS Export Compatible to Webpack 5#10
dheerajsharmaRP wants to merge 1 commit into
sdinteractive:masterfrom
dheerajsharmaRP:bugfix/fixing-webpack5-js-export-registration

Conversation

@dheerajsharmaRP

@dheerajsharmaRP dheerajsharmaRP commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

PR Summary:
We investigated and fixed the webpack 5 migration of the RequireJsExportPlugin. The original webpack 4 implementation exported modules by injecting code directly into each module, but during the webpack 5 upgrade this had been replaced with runtime capture using webpack_require, which caused cross-chunk dependency issues, missing jQuery/core-js modules, and failed exports. We restored the original behavior by using webpack 5's JavascriptModulesPlugin.renderModuleContent hook to inject export registration into each module, with safeguards for non-ES modules. After the change, RequireJS aliases and module exports work correctly again, and the site is functioning without console errors.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant