@@ -64,7 +64,7 @@ export interface Options {
6464 reactRefreshHost ?: string
6565
6666 /**
67- * If set, disables the recommendation to use `@vitejs/ plugin-react-oxc`
67+ * If set, disables the recommendation to use `vite- plugin-react-oxc`
6868 */
6969 disableOxcRecommendation ?: boolean
7070}
@@ -136,16 +136,6 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
136136 name : 'vite:react-babel' ,
137137 enforce : 'pre' ,
138138 config ( ) {
139- if (
140- 'rolldownVersion' in vite &&
141- ! opts . disableOxcRecommendation &&
142- ! opts . babel
143- ) {
144- // Suggest to use vite-plugin-react-oxc if `rolldown-vite` is used and no babel config is set
145- console . warn (
146- '[vite:react-babel] We recommend switching to `vite-plugin-react-oxc` for improved performance. More information at https://vite.dev/rolldown' ,
147- )
148- }
149139 if ( opts . jsxRuntime === 'classic' ) {
150140 if ( 'rolldownVersion' in vite ) {
151141 return {
@@ -184,6 +174,17 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
184174 config . command === 'build' ||
185175 config . server . hmr === false
186176
177+ if (
178+ 'rolldownVersion' in vite &&
179+ ! opts . disableOxcRecommendation &&
180+ ! opts . babel
181+ ) {
182+ // Suggest to use vite-plugin-react-oxc if `rolldown-vite` is used and no babel config is set
183+ config . logger . warn (
184+ '[vite:react-babel] We recommend switching to `vite-plugin-react-oxc` for improved performance. More information at https://vite.dev/rolldown' ,
185+ )
186+ }
187+
187188 if ( 'jsxPure' in opts ) {
188189 config . logger . warnOnce (
189190 '[@vitejs/plugin-react] jsxPure was removed. You can configure esbuild.jsxSideEffects directly.' ,
0 commit comments