-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
fix(vite): use arrow functions in dynamic imports #32285
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
|
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 fixes a Rollup bug related to dynamic imports by enabling arrow functions in the generated code configuration.
- Enables the arrowFunctions flag to help preserve default exports in dynamic imports.
- Adds a comment referencing the Rollup issue for future context.
WalkthroughA new property, arrowFunctions: true, has been added to the generatedCode configuration object within the Rollup output options in the Vite server build configuration. This adjustment serves as a temporary workaround for a specific issue reported in the Rollup project. No other aspects of the logic, error handling, or control flow have been changed, and there are no modifications to the declarations of exported or public entities. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@nuxt/kit
nuxt
@nuxt/rspack-builder
@nuxt/schema
@nuxt/vite-builder
@nuxt/webpack-builder
commit: |
CodSpeed Performance ReportMerging #32285 will not alter performanceComparing Summary
|
🔗 Linked issue
resolves #32175
📚 Description
due to an upstream rollup bug in how arrow functions vs inline functions are treated (it fails to collect dependencies correctly), it strips default exports from dynamically imported modules
by emitting arrow functions instead we bypass this, but we can revisit when it a fix is merged upstream