Skip to content

Commit c5d950c

Browse files
committed
Fix env config
1 parent 770d37c commit c5d950c

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • packages/start/src/config

packages/start/src/config/env.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ const LOADERS = {
88

99
export 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
}

0 commit comments

Comments
 (0)