Fix runtime asset manifest loading in prod

This commit is contained in:
scamiv
2026-03-22 17:26:17 +01:00
parent 2cafb71b79
commit 1e78e8668c
2 changed files with 8 additions and 2 deletions
+3
View File
@@ -14,10 +14,13 @@ const HASHED_PUBLIC_ASSET_GLOBS = [
"manifest.json",
"cosmetics/**/*",
"flags/**/*",
"fonts/**/*",
"icons/**/*",
"images/**/*",
"lang/**/*",
"maps/**/*",
"sounds/**/*",
"sprites/**/*",
] as const;
const ROOT_PUBLIC_FILES = new Set([
+5 -2
View File
@@ -1,3 +1,4 @@
import fs from "fs";
import path from "path";
import { fileURLToPath, pathToFileURL } from "url";
import type { AssetManifest } from "../core/AssetUrls";
@@ -23,11 +24,13 @@ async function importRuntimeAssetManifest(
}
export async function getRuntimeAssetManifest(): Promise<AssetManifest> {
if (process.env.GAME_ENV !== "prod") {
if (!fs.existsSync(manifestPath)) {
return {};
}
manifestPromise ??= importRuntimeAssetManifest(manifestVersion);
manifestPromise ??= importRuntimeAssetManifest(manifestVersion).catch(
() => ({}),
);
return manifestPromise;
}