refactor: rename webpack external vars to rspack format#12249
refactor: rename webpack external vars to rspack format#12249chenjiahan merged 1 commit intomainfrom
Conversation
✅ Deploy Preview for rspack ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the naming convention for webpack/rspack external and import variables to align with rspack's branding and format. The main changes include renaming __WEBPACK_EXTERNAL_MODULE_xxx__ to __rspack_external_xxx and removing unnecessary trailing underscores from __rspack_import variables (changing from __rspack_import_0__ to __rspack_import_0).
Key Changes
- Updated external module variable naming from webpack format to rspack format across the codebase
- Removed trailing underscores from rspack import variables for cleaner syntax
- Updated all documentation, test snapshots, and configuration files to reflect the new naming convention
Reviewed Changes
Copilot reviewed 143 out of 143 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/rspack_core/src/external_module.rs | Core logic for external module variable naming updated to use __rspack_external_ prefix |
| crates/rspack_core/src/compilation/mod.rs | Import variable generation updated to remove trailing underscores |
| crates/rspack_plugin_javascript/src/plugin/api_plugin.rs | Plugin rendering updated for createRequire external variable |
| crates/rspack_plugin_javascript/src/parser_plugin/api_plugin.rs | Parser plugin updated to use new createRequire variable name |
| crates/rspack_plugin_library/src/utils.rs | Library plugin utility updated for external arguments formatting |
| crates/rspack_plugin_library/src/system_library_plugin.rs | System library plugin comments updated |
| website/docs/en/config/externals.mdx | English documentation updated with new variable naming examples |
| website/docs/zh/config/externals.mdx | Chinese documentation updated with new variable naming examples |
| tests/rspack-test/**/*.snap.txt | All test snapshots updated to reflect new naming convention |
| tests/rspack-test/configCases/**/*.js | Config test cases updated with new naming expectations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📦 Binary Size-limit
🎉 Size decreased by 128bytes from 47.62MB to 47.62MB (⬇️0.00%) |
CodSpeed Performance ReportMerging #12249 will not alter performanceComparing Summary
|
Summary
WEBPACK_EXTERNAL_MODULE_xxx__torspack_external_xxx.rspack_importSee #12244 for more details.
Checklist