Skip to content

Commit f2a4791

Browse files
committed
feat: set optimizeDeps.rollupOptions.transform.jsx instead of optimizeDeps.rollupOptions.jsx
1 parent fd96308 commit f2a4791

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

packages/plugin-react-oxc/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default function viteReact(opts: Options = {}): Plugin[] {
5858
jsxImportDevRuntime,
5959
jsxImportRuntime,
6060
],
61-
rollupOptions: { jsx: { mode: 'automatic' } },
61+
rollupOptions: { transform: { jsx: { runtime: 'automatic' } } },
6262
},
6363
}
6464
},

packages/plugin-react-swc/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ const react = (_options?: Options): Plugin[] => {
132132
optimizeDeps: {
133133
include: [`${options.jsxImportSource}/jsx-dev-runtime`],
134134
...('rolldownVersion' in vite
135-
? { rollupOptions: { jsx: { mode: 'automatic' } } }
135+
? {
136+
rollupOptions: { transform: { jsx: { runtime: 'automatic' } } },
137+
}
136138
: { esbuildOptions: { jsx: 'automatic' } }),
137139
},
138140
}),

packages/plugin-react/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ export default function viteReact(opts: Options = {}): Plugin[] {
159159
jsxRefreshInclude: include,
160160
jsxRefreshExclude: exclude,
161161
},
162-
optimizeDeps: { rollupOptions: { jsx: { mode: 'automatic' } } },
162+
optimizeDeps: {
163+
rollupOptions: { transform: { jsx: { runtime: 'automatic' } } },
164+
},
163165
}
164166
}
165167
}

0 commit comments

Comments
 (0)