File tree Expand file tree Collapse file tree 3 files changed +23
-26
lines changed 
packages/vite-plugin-react-reanimated-lightning/src Expand file tree Collapse file tree 3 files changed +23
-26
lines changed Original file line number Diff line number Diff line change 1+ --- 
2+ " @plextv/vite-plugin-react-reanimated-lightning " patch 
3+ --- 
4+ 
5+ fix(vite-plugin-react-reanimated-lightning): Fix worklet script alias for older versions
Load Diff This file was deleted. 
Original file line number Diff line number Diff line change @@ -7,24 +7,32 @@ type Options = {
77
88const  plugin  =  ( options ?: Options ) : Plugin  =>  { 
99  const  require  =  createRequire ( options ?. cwd  ??  process . cwd ( ) ) ; 
10-   const  reactNativeLightningReanimatedPath  =  require . resolve ( 
10+ 
11+   const  alias : Record < string ,  string >  =  { } ; 
12+ 
13+   // This needs to be first 
14+   try  { 
15+     alias [ 'react-native-reanimated/scripts/validate-worklets-version' ]  = 
16+       require . resolve ( 
17+         'react-native-reanimated/scripts/validate-worklets-version' , 
18+       ) ; 
19+   }  catch  { 
20+     // Do nothing 
21+   } 
22+ 
23+   alias [ 'react-native-reanimated' ]  =  require . resolve ( 
1124    '@plextv/react-lightning-plugin-reanimated' , 
1225  ) ; 
13-   const  reactReanimatedPath  =  require . resolve ( 'react-native-reanimated' ) ; 
26+   alias [ 'react-native-reanimated-original' ]  =  require . resolve ( 
27+     'react-native-reanimated' , 
28+   ) ; 
1429
1530  return  { 
1631    name : 'vite-react-reanimated-lightning' , 
1732    enforce : 'pre' , 
1833    config : ( )  =>  ( { 
1934      resolve : { 
20-         alias : { 
21-           'react-native-reanimated/scripts/validate-worklets-version' :
22-             require . resolve ( 
23-               'react-native-reanimated/scripts/validate-worklets-version' , 
24-             ) , 
25-           'react-native-reanimated' : reactNativeLightningReanimatedPath , 
26-           'react-native-reanimated-original' : reactReanimatedPath , 
27-         } , 
35+         alias, 
2836      } , 
2937    } ) , 
3038  } ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments