refactor: rename webpack reexport vars to Rspack format#12263
Merged
chenjiahan merged 2 commits intomainfrom Nov 22, 2025
Merged
refactor: rename webpack reexport vars to Rspack format#12263chenjiahan merged 2 commits intomainfrom
chenjiahan merged 2 commits intomainfrom
Conversation
✅ Deploy Preview for rspack canceled.
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the variable naming convention for reexport and external module helpers to follow the Rspack naming format instead of the legacy Webpack naming. The changes standardize internal variable names across the codebase and generated output.
- Updates ESM reexport variable names from Webpack-style to Rspack-style
- Simplifies external module helper variable names by removing the redundant "external" prefix
- Updates all test snapshots to reflect the new naming convention
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs | Updates ESM reexport variable names from __WEBPACK_REEXPORT_OBJECT__ to __rspack_reexport and __WEBPACK_IMPORT_KEY__ to __rspack_import_key |
| crates/rspack_core/src/external_module.rs | Simplifies createRequire variable names from __rspack_external_createRequire to __rspack_createRequire |
| crates/rspack_plugin_javascript/src/plugin/api_plugin.rs | Updates createRequire import and variable declaration with simplified naming |
| crates/rspack_plugin_javascript/src/parser_plugin/api_plugin.rs | Updates the generated require variable name in API plugin |
| tests/rspack-test/configCases/library/esm-external/index.js | Updates test assertion to check for new variable name |
| tests/rspack-test/configCases/externals/module-import/index.js | Updates test assertion to check for new variable name |
| tests/rspack-test/configCases/library/modern-module-force-concaten/snapshot/f.js.txt | Updates snapshot with new variable names |
| tests/rspack-test/esmOutputCases/externals/externals-aliased/snapshots/esm.snap.txt | Updates snapshot with new variable names |
| tests/rspack-test/esmOutputCases/externals/aliased/snapshots/esm.snap.txt | Updates snapshot with new variable names |
| tests/rspack-test/esmOutputCases/dynamic-import/magic-comment/snapshots/esm.snap.txt | Updates snapshot with new variable names |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
📦 Binary Size-limit
❌ Size increased by 4.00KB from 47.63MB to 47.63MB (⬆️0.01%) |
CodSpeed Performance ReportMerging #12263 will not alter performanceComparing Summary
|
LingyuCoder
approved these changes
Nov 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Update reexport variable naming convention:
__WEBPACK_REEXPORT_OBJECT__->__rspack_reexport__WEBPACK_IMPORT_KEY__->__rspack_import_keyAlso simplified the
createRequirevariables:__rspack_external_createRequire->__rspack_createRequire__rspack_external_createRequire_require->__rspack_createRequire_requireSee #12244 for more details.
Checklist