Fix Turbopack module resolution for lzma and restore path imports
This commit is contained in:
1 parent
a5044c80d7
commit
e06596391e
35 files changed
+392
-333
No files matched your search
@@ -9,6 +9,7 @@ import {
|
||||
import type { OfficialHabboFurniEntry } from "@/lib/services/habbo-furnidata-cache";
|
||||
import { siteSettings } from "@/lib/services/site-settings";
|
||||
import type { FurniMetadata } from "@/lib/services/swf-to-nitro";
|
||||
import { getRuntimePath } from "@/lib/utils/runtime-path";
|
||||
|
||||
const LOCK_STALE_MS = 60_000;
|
||||
const DEFAULT_FURNI_DATA_URL = "/gamedata/config/FurnitureData.json";
|
||||
@@ -27,14 +28,18 @@ export async function getFurnitureDataPath(): Promise<string> {
|
||||
const gamedataRoot = await getGamedataRoot();
|
||||
if (gamedataRoot) {
|
||||
const relative = url.replace(/^\/gamedata\/?/, "");
|
||||
return path.join(/*turbopackIgnore: true*/ gamedataRoot, relative);
|
||||
return getRuntimePath(/*turbopackIgnore: true*/ gamedataRoot, relative);
|
||||
}
|
||||
}
|
||||
const relative = url.replace(/^\/+/, "");
|
||||
// The `relative` segment is admin-configurable so its concrete value is
|
||||
// unknown at build time; without the hint Turbopack traces the entire
|
||||
// public/ tree (~400k files) into the route's NFT.
|
||||
return path.join(/*turbopackIgnore: true*/ process.cwd(), "public", relative);
|
||||
return getRuntimePath(
|
||||
/*turbopackIgnore: true*/ process.cwd(),
|
||||
"public",
|
||||
relative,
|
||||
);
|
||||
}
|
||||
|
||||
export async function getFurnitureDataWritePaths(): Promise<string[]> {
|
||||
@@ -48,14 +53,14 @@ export async function getFurnitureDataWritePaths(): Promise<string[]> {
|
||||
const mirror = configuredMirror.trim()
|
||||
? configuredMirror
|
||||
: nitroFilesRoot
|
||||
? path.join(
|
||||
? getRuntimePath(
|
||||
/*turbopackIgnore: true*/ nitroFilesRoot,
|
||||
"nitro-assets/gamedata/FurnitureData.json",
|
||||
)
|
||||
: "";
|
||||
|
||||
const gamedataPath = gamedataRoot
|
||||
? path.join(
|
||||
? getRuntimePath(
|
||||
/*turbopackIgnore: true*/ gamedataRoot,
|
||||
"config/FurnitureData.json",
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user