File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " @solidjs/start " : patch
3+ ---
4+
5+ Use per-environment Vite plugin hook APIs for forward compatibility with Vite 9.
Original file line number Diff line number Diff line change 8989 "vitest" : " ^4.1.0"
9090 },
9191 "peerDependencies" : {
92- "vite" : " ^8"
92+ "vite" : " ^8 || ^9 "
9393 }
9494}
Original file line number Diff line number Diff line change @@ -71,9 +71,10 @@ export function envPlugin(options?: EnvPluginOptions): Plugin {
7171 }
7272 return undefined ;
7373 } ,
74- load ( id , opts ) {
74+ load ( id ) {
75+ const isServer = this . environment . config . consumer === "server" ;
7576 if ( id === SERVER_ENV ) {
76- if ( ! opts ?. ssr ) {
77+ if ( ! isServer ) {
7778 return SERVER_ONLY_MODULE ;
7879 }
7980 const vars = currentOptions . server ?. load
@@ -88,13 +89,13 @@ export function envPlugin(options?: EnvPluginOptions): Plugin {
8889 return convertObjectToModule ( vars ) ;
8990 }
9091 if ( id === SERVER_RUNTIME_LOADER ) {
91- if ( ! opts ?. ssr ) {
92+ if ( ! isServer ) {
9293 return SERVER_ONLY_MODULE ;
9394 }
9495 return runtimeCode ;
9596 }
9697 if ( id === SERVER_RUNTIME_ENV ) {
97- if ( ! opts ?. ssr ) {
98+ if ( ! isServer ) {
9899 return SERVER_ONLY_MODULE ;
99100 }
100101 return SERVER_RUNTIME_CODE ;
Original file line number Diff line number Diff line change @@ -181,8 +181,8 @@ export function serverFunctionsPlugin(options: ServerFunctionsOptions): Plugin[]
181181 }
182182 return null ;
183183 } ,
184- async load ( id , opts ) {
185- const mode = opts ?. ssr ? "server" : "client" ;
184+ async load ( id ) {
185+ const mode = this . environment . config . consumer ;
186186 if ( id === options . manifest ) {
187187 const current = new Debouncer ( ( ) =>
188188 [ ...manifest [ mode ] ] . map ( entry => `import "${ entry } ";` ) . join ( "\n" ) ,
@@ -197,8 +197,8 @@ export function serverFunctionsPlugin(options: ServerFunctionsOptions): Plugin[]
197197 {
198198 name : "solid-start:server-functions/compiler" ,
199199 enforce : 'pre' ,
200- async transform ( code , fileId , opts ) {
201- const mode = opts ?. ssr ? "server" : "client" ;
200+ async transform ( code , fileId ) {
201+ const mode = this . environment . config . consumer ;
202202 const [ id ] = fileId . split ( "?" ) ;
203203 if ( ! filter ( id ) ) {
204204 return null ;
You can’t perform that action at this time.
0 commit comments