Skip to content

refactor: rename webpack external vars to rspack format#12249

Merged
chenjiahan merged 1 commit intomainfrom
external_vars_1120
Nov 20, 2025
Merged

refactor: rename webpack external vars to rspack format#12249
chenjiahan merged 1 commit intomainfrom
external_vars_1120

Conversation

@chenjiahan
Copy link
Member

Summary

  • Update import variable naming convention from WEBPACK_EXTERNAL_MODULE_xxx__ to rspack_external_xxx.
  • Remove unnecessary trailing underscores from rspack_import

See #12244 for more details.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings November 20, 2025 07:13
@netlify
Copy link

netlify bot commented Nov 20, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit 3035f2a
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/691ebf815b28a300086d658d
😎 Deploy Preview https://deploy-preview-12249--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added release: refactor team The issue/pr is created by the member of Rspack. labels Nov 20, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions
Copy link
Contributor

📦 Binary Size-limit

Comparing 3035f2a to fix: generate stable extract css runtime by sorting css chunks (#12246) by harpsealjs

🎉 Size decreased by 128bytes from 47.62MB to 47.62MB (⬇️0.00%)

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 20, 2025

CodSpeed Performance Report

Merging #12249 will not alter performance

Comparing external_vars_1120 (3035f2a) with main (92f28c7)

Summary

✅ 17 untouched

@chenjiahan chenjiahan enabled auto-merge (squash) November 20, 2025 07:40
@chenjiahan chenjiahan merged commit d8cd46f into main Nov 20, 2025
56 checks passed
@chenjiahan chenjiahan deleted the external_vars_1120 branch November 20, 2025 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: refactor team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants