Inline worker config env fallback

This commit is contained in:
scamiv
2026-03-24 14:26:34 +01:00
parent bdf17f3f87
commit 7c3e77f5bc
+2 -2
View File
@@ -43,8 +43,8 @@ export async function getServerConfigFromClient(): Promise<ServerConfig> {
typeof window !== "undefined"
? window.BOOTSTRAP_CONFIG?.gameEnv
: undefined;
const bundledGameEnv =
typeof process !== "undefined" ? process.env?.GAME_ENV : undefined;
// Vite replaces this at build time for browser and worker bundles.
const bundledGameEnv = process.env.GAME_ENV;
const gameEnv = bootstrapGameEnv ?? bundledGameEnv;
if (!gameEnv) {
throw new Error("Missing client server config");