mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 12:10:46 +00:00
Fix runtime asset manifest loading in prod
This commit is contained in:
@@ -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([
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user