-
-
Notifications
You must be signed in to change notification settings - Fork 746
fix: render external re-exports #12089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
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 enhances support for re-exporting from external modules in ESM library output by introducing more granular handling of different export patterns. Previously, only export * from external modules was optimized; now the plugin handles all re-export forms including named exports, default exports, and namespace exports from external modules.
Key Changes
- Modified the re-export data structure to support both chunk-based and request-based (external module) re-exports
- Added comprehensive handling for all
ExportModevariants when re-exporting from external modules - Enhanced the rendering logic to distinguish between chunk re-exports and external module re-exports
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crates/rspack_plugin_esm_library/src/chunk_link.rs | Introduced ReExportFrom enum to differentiate chunk vs. request-based re-exports; changed raw_star_exports from set to map to track export names |
| crates/rspack_plugin_esm_library/src/link.rs | Added re_export_from_external_module function to handle all external module re-export modes; added logic to skip external re-exports when collecting exports |
| crates/rspack_plugin_esm_library/src/render.rs | Updated rendering logic to handle both star exports with names and re-exports from external modules vs. chunks |
| tests/rspack-test/esmOutputCases/re-exports/*/*.snap.txt | Updated test snapshots to reflect new external module re-export output format |
| tests/rspack-test/esmOutputCases/re-exports/re-export-namespaced-external/*.js | Added new test case for external module re-exports with various export patterns |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📦 Binary Size-limit
❌ Size increased by 11.13KB from 47.85MB to 47.86MB (⬆️0.02%) |
179cd7f to
08ea7b8
Compare
CodSpeed Performance ReportMerging #12089 will not alter performanceComparing Summary
|
a7ca36e to
32ac475
Compare
Summary
Special handle for re-export from external module. Should render re-exports for all ExportMode
Related links
Checklist