Skip to content

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).

@sapphi-red sapphi-red merged commit 552af8f into main Jun 23, 2025
11 checks passed
@sapphi-red sapphi-red deleted the feat/add-raw-rolldown-support branch June 23, 2025 01:49
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

3 participants