Skip to content

feat(react): add raw rolldown support #513

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sapphi-red
Copy link
Member

Description

This adds raw rolldown support. This will make @vitejs/plugin-react to be able to use with rolldown / tsdown.
While the plugins mainly focuses on react-refresh, user may use this plugin for react-compiler.
It'd be nice to make this plugin work with rolldown / tsdown in those cases.
Since the reason is react-compiler, I only made changes to @vitejs/plugin-react.

fixes rolldown/tsdown#294

@sapphi-red sapphi-red added p2-nice-to-have 🍰 Not breaking anything but nice to have (priority) plugin: react labels Jun 18, 2025
Copy link
Member

@ArnaudBarre ArnaudBarre left a comment

Choose a reason for hiding this comment

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

My personal feeling is that a rolldown-babel plugin would take less than 20 lines to write and would be better suited than this one that most of the logic would be useless. But I can understand that people want to use the same dep for various needs

"react": "^19.1.0",
"react-dom": "^19.1.0",
"rolldown": "1.0.0-beta.17",
"unbuild": "^3.5.0",
Copy link
Member

Choose a reason for hiding this comment

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

we should use tsdown 👀

@sapphi-red
Copy link
Member Author

Users can use @rollup/plugin-babel. I think the upside of supporting it here is that we may introduce some react specific optimization if possible (e.g. only process some modules that contains react compiler needs to handle).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have 🍰 Not breaking anything but nice to have (priority) plugin: react
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using @vitejs/plugin-react always inlines @react-refresh code
2 participants