-
-
Notifications
You must be signed in to change notification settings - Fork 736
feat: support shorthand function for module factory to reduce bundle size #12226
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
base: main
Are you sure you want to change the base?
Conversation
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 introduces support for ES2015 object method shorthand syntax in module factory definitions to reduce bundle size. When the target environment supports this feature, module factories are rendered using shorthand notation instead of the traditional function property syntax.
Key Changes
- Module factories now use shorthand syntax (
"./src/app.ts"() {}) instead of traditional function properties ("./src/app.ts": function() {}) - This optimization reduces bundle size by eliminating the
: functionportion of each module factory definition
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
✅ Deploy Preview for rspack canceled.
|
📦 Binary Size-limit
❌ Size increased by 1.00KB from 47.48MB to 47.48MB (⬆️0.00%) |
CodSpeed Performance ReportMerging #12226 will not alter performanceComparing Summary
|
1d24028 to
27674f7
Compare
575336c to
36fd48b
Compare
36fd48b to
4dae46c
Compare
Summary
Introducing new
output.environment.methodShorthand. If target environment support this, module factories will be rendered as object method shorthand form.Before
This PR:
Related links
Checklist