File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
1212  transform , 
1313}  from  '@swc/core' 
1414import  type  {  PluginOption  }  from  'vite' 
15+ import  *  as  vite  from  'vite' 
1516import  { 
1617  addRefreshWrapper , 
1718  getPreambleCode , 
@@ -124,7 +125,9 @@ const react = (_options?: Options): PluginOption[] => {
124125        oxc : false , 
125126        optimizeDeps : { 
126127          include : [ `${ options . jsxImportSource }  /jsx-dev-runtime` ] , 
127-           esbuildOptions : {  jsx : 'automatic'  } , 
128+           ...( 'rolldownVersion'  in  vite 
129+             ? {  rollupOptions : {  jsx : {  mode : 'automatic'  }  }  } 
130+             : {  esbuildOptions : {  jsx : 'automatic'  }  } ) , 
128131        } , 
129132      } ) , 
130133      configResolved ( config )  { 
Original file line number Diff line number Diff line change @@ -157,7 +157,10 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
157157            jsx : 'automatic' , 
158158            jsxImportSource : opts . jsxImportSource , 
159159          } , 
160-           optimizeDeps : {  esbuildOptions : {  jsx : 'automatic'  }  } , 
160+           optimizeDeps :
161+             'rolldownVersion'  in  vite 
162+               ? {  rollupOptions : {  jsx : {  mode : 'automatic'  }  }  } 
163+               : {  esbuildOptions : {  jsx : 'automatic'  }  } , 
161164        } 
162165      } 
163166    } , 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments