fix: use modern syntax for reexport runtime#12268
Conversation
✅ Deploy Preview for rspack canceled.
|
There was a problem hiding this comment.
Pull request overview
This PR modernizes the syntax for Rspack reexport bindings by checking environment support for const and arrow functions, aligning with webpack's implementation. The changes ensure that generated code is compatible with the target environment by using modern syntax (const, arrow functions) when supported, and falling back to legacy syntax (var, regular functions) otherwise.
- Adds environment support checks for
constand arrow functions - Conditionally generates modern or legacy syntax for dynamic reexports
- Aligns implementation with webpack's approach
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📦 Binary Size-limit
❌ Size increased by 4.38KB from 47.63MB to 47.63MB (⬆️0.01%) |
CodSpeed Performance ReportMerging #12268 will not alter performanceComparing Summary
|
Summary
Check environment support for const and arrow functions to generate appropriate syntax for Rspack's reexport runtime.
Align with webpack: https://github.com/webpack/webpack/blob/main/lib/dependencies/HarmonyExportImportedSpecifierDependency.js#L1237-L1256
Checklist