File tree Expand file tree Collapse file tree
packages/start/src/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,12 +8,12 @@ const LOADERS = {
88
99export interface EnvPluginOptions {
1010 server ?: {
11- runtime : keyof typeof LOADERS | ( string & { } ) ;
12- load ?: ( ) => Record < string , string > ;
11+ runtime ? : keyof typeof LOADERS | ( string & { } ) ;
12+ load ?: ( mode : string ) => Record < string , string > ;
1313 prefix ?: string ;
1414 } ;
1515 client ?: {
16- load ?: ( ) => Record < string , string > ;
16+ load ?: ( mode : string ) => Record < string , string > ;
1717 prefix ?: string ;
1818 } ;
1919}
@@ -77,13 +77,13 @@ export function envPlugin(options?: EnvPluginOptions): Plugin {
7777 return SERVER_ONLY_MODULE ;
7878 }
7979 const vars = currentOptions . server ?. load
80- ? currentOptions . server . load ( )
80+ ? currentOptions . server . load ( env )
8181 : loadEnv ( env , '.' , serverPrefix ) ;
8282 return convertObjectToModule ( vars ) ;
8383 }
8484 if ( id === CLIENT_ENV ) {
8585 const vars = currentOptions . client ?. load
86- ? currentOptions . client . load ( )
86+ ? currentOptions . client . load ( env )
8787 : loadEnv ( env , '.' , clientPrefix ) ;
8888 return convertObjectToModule ( vars ) ;
8989 }
You can’t perform that action at this time.
0 commit comments