Skip to content

Commit cdbfb59

Browse files
committed
fix(env): add guards
1 parent 4bb956e commit cdbfb59

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • packages/start/src/config

packages/start/src/config/env.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,15 @@ export function envPlugin(options?: EnvPluginOptions): Plugin {
8888
return convertObjectToModule(vars);
8989
}
9090
if (id === SERVER_RUNTIME_LOADER) {
91+
if (!opts?.ssr) {
92+
return SERVER_ONLY_MODULE;
93+
}
9194
return runtimeCode;
9295
}
9396
if (id === SERVER_RUNTIME_ENV) {
97+
if (!opts?.ssr) {
98+
return SERVER_ONLY_MODULE;
99+
}
94100
return SERVER_RUNTIME_CODE;
95101
}
96102
return null;

0 commit comments

Comments
 (0)