Skip to content
Discussion options

You must be logged in to vote

Use the generated @vitejs/plugin-react setup for this today; unplugin-oxc is not a drop-in replacement for the React Compiler path in Vite.

@vitejs/plugin-react v6 already uses Vite/Oxc for the normal JSX + React Refresh transform, but its React Compiler support is explicitly exposed through reactCompilerPreset() for @rolldown/plugin-babel + babel-plugin-react-compiler:

plugins: [react(), babel({ presets: [reactCompilerPreset()] })]

The duplicate React symptom you are seeing is consistent with a separate transform producing a JSX-runtime import that does not go through the same optimized dependency entry as the rest of the React graph. I would remove unplugin-oxc for React files and keep …

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by xandris
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@xandris
Comment options

@xandris
Comment options

@R-Bower
Comment options

@xandris
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants