refactor: rename webpack imported vars to rspack format#12245
Merged
chenjiahan merged 3 commits intomainfrom Nov 20, 2025
Merged
refactor: rename webpack imported vars to rspack format#12245chenjiahan merged 3 commits intomainfrom
chenjiahan merged 3 commits intomainfrom
Conversation
✅ Deploy Preview for rspack ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the import variable naming convention from webpack's WEBPACK_IMPORTED_MODULE format to rspack's rspack_import format, aligning with the discussion in #12244.
- Renames all imported module variables from
*__WEBPACK_IMPORTED_MODULE_N__to*__rspack_import_N__ - Updates core code generation logic in the compilation module and wasm plugin
- Updates all test snapshots to reflect the new naming convention
Reviewed Changes
Copilot reviewed 128 out of 128 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
crates/rspack_core/src/compilation/mod.rs |
Updates core import variable generation logic to use rspack_import format |
crates/rspack_plugin_wasm/src/parser_and_generator.rs |
Updates wasm module import variable naming to rspack_import format |
website/docs/en/config/externals.mdx |
Updates documentation example with new import variable names |
website/docs/zh/config/externals.mdx |
Updates Chinese documentation example with new import variable names |
tests/rspack-test/treeShakingCases/**/*.snap.txt |
Updates tree shaking test snapshots with new naming convention |
tests/rspack-test/hotCases/**/*.snap.txt |
Updates hot module replacement test snapshots |
tests/rspack-test/builtinCases/**/*.snap.txt |
Updates builtin test case snapshots |
tests/rspack-test/configCases/**/*.js |
Updates config test cases to match new import variable format |
tests/rspack-test/esmOutputCases/**/*.snap.txt |
Updates ESM output test snapshots |
tests/rspack-test/statsOutputCases/**/*.snap.txt |
Updates stats output test snapshots |
tests/rspack-test/hookCases/**/*.snap.txt |
Updates hook test case snapshots |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
📦 Binary Size-limit
🙈 Size remains the same at 47.62MB |
CodSpeed Performance ReportMerging #12245 will not alter performanceComparing Summary
|
LingyuCoder
approved these changes
Nov 20, 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 import variable naming convention from
WEBPACK_IMPORTED_MODULEtorspack_import.See #12244 for more details.
Checklist