File tree 1 file changed +10
-5
lines changed
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,16 @@ const react = (_options?: Options): PluginOption[] => {
56
56
} ;
57
57
58
58
return [
59
+ {
60
+ name : "vite:react-swc:resolve-runtime" ,
61
+ apply : "serve" ,
62
+ enforce : "pre" , // Run before Vite default resolve to avoid syscalls
63
+ resolveId : ( id ) => ( id === runtimePublicPath ? id : undefined ) ,
64
+ load : ( id ) =>
65
+ id === runtimePublicPath
66
+ ? readFileSync ( join ( _dirname , "refresh-runtime.js" ) , "utf-8" )
67
+ : undefined ,
68
+ } ,
59
69
{
60
70
name : "vite:react-swc" ,
61
71
apply : "serve" ,
@@ -65,11 +75,6 @@ const react = (_options?: Options): PluginOption[] => {
65
75
include : [ `${ options . jsxImportSource } /jsx-dev-runtime` ] ,
66
76
} ,
67
77
} ) ,
68
- resolveId : ( id ) => ( id === runtimePublicPath ? id : undefined ) ,
69
- load : ( id ) =>
70
- id === runtimePublicPath
71
- ? readFileSync ( join ( _dirname , "refresh-runtime.js" ) , "utf-8" )
72
- : undefined ,
73
78
transformIndexHtml : ( _ , config ) => [
74
79
{
75
80
tag : "script" ,
You can’t perform that action at this time.
0 commit comments