File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' vite-plugin-solid ' : patch
3+ ---
4+
5+ fix: preserve jsx for rolldown dep scan
Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ const runtimePublicPath = '/@solid-refresh';
1414const runtimeFilePath = require . resolve ( 'solid-refresh/dist/solid-refresh.mjs' ) ;
1515const runtimeCode = readFileSync ( runtimeFilePath , 'utf-8' ) ;
1616
17- const isVite6 = + version . split ( '.' ) [ 0 ] >= 6 ;
17+ const viteVersionMajor = + version . split ( '.' ) [ 0 ] ;
18+ const isVite6 = viteVersionMajor >= 6 ;
19+ const isVite8 = viteVersionMajor >= 8 ;
1820
1921/** Possible options for the extensions property */
2022export interface ExtensionOptions {
@@ -277,6 +279,13 @@ export default function solidPlugin(options: Partial<Options> = {}): Plugin {
277279 optimizeDeps : {
278280 include : [ ...nestedDeps , ...solidPkgsConfig . optimizeDeps . include ] ,
279281 exclude : solidPkgsConfig . optimizeDeps . exclude ,
282+ // Vite 8+ uses Rolldown for dependency scanning. Rolldown defaults to
283+ // React's automatic JSX runtime for .tsx files, injecting a
284+ // react/jsx-dev-runtime import. Tell it to preserve JSX as-is since
285+ // this plugin handles JSX transformation via babel-preset-solid.
286+ ...( isVite8
287+ ? { rolldownOptions : { transform : { jsx : 'preserve' as const } } }
288+ : { } ) ,
280289 } ,
281290 ...( ! isVite6 ? { ssr : solidPkgsConfig . ssr } : { } ) ,
282291 ...( test . server ? { test } : { } ) ,
You can’t perform that action at this time.
0 commit comments