chore: add three devtools debug mode #5

Merged
math-pixel merged 3 commits from feat/code-review into develop 2026-05-12 14:05:33 +00:00
3 changed files with 35 additions and 14 deletions
+1
View File
@@ -8,6 +8,7 @@
}, },
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"dev:three-debug": "vite --mode three-debug --host 0.0.0.0",
"build": "tsc -b && vite build", "build": "tsc -b && vite build",
"lint": "eslint .", "lint": "eslint .",
"lint:fix": "eslint . --fix", "lint:fix": "eslint . --fix",
+1 -1
View File
@@ -52,7 +52,7 @@ export const REPAIR_MISSIONS: Record<RepairMissionId, RepairMissionConfig> = {
description: description:
"Repair the damaged cooling module before relaunching the bike", "Repair the damaged cooling module before relaunching the bike",
modelPath: "/models/ebike/model.gltf", modelPath: "/models/ebike/model.gltf",
modelScale: 0.0055, modelScale: 0.50,
stageUiPath: "/assets/UI/ebike.webm", stageUiPath: "/assets/UI/ebike.webm",
interactUiPath: REPAIR_INTERACT_UI_PATH, interactUiPath: REPAIR_INTERACT_UI_PATH,
brokenUiPath: REPAIR_BROKEN_UI_PATH, brokenUiPath: REPAIR_BROKEN_UI_PATH,
+23 -3
View File
@@ -9,6 +9,9 @@ import { parseMapNodes } from "./src/utils/map/mapNodeValidation";
import { parseSrt } from "./src/utils/subtitles/parseSrt"; import { parseSrt } from "./src/utils/subtitles/parseSrt";
const __dirname = fileURLToPath(new URL(".", import.meta.url)); const __dirname = fileURLToPath(new URL(".", import.meta.url));
const THREE_SOURCE_ENTRY = fileURLToPath(
new URL("./node_modules/three/src/Three.js", import.meta.url),
);
const MAX_MAP_PAYLOAD_BYTES = 1024 * 1024; const MAX_MAP_PAYLOAD_BYTES = 1024 * 1024;
const MAX_SRT_PAYLOAD_BYTES = 256 * 1024; const MAX_SRT_PAYLOAD_BYTES = 256 * 1024;
@@ -634,7 +637,10 @@ function resolvePublicPath(publicPath: string): string | null {
return resolvedPath; return resolvedPath;
} }
export default defineConfig({ export default defineConfig(({ mode }) => {
const isThreeDebug = mode === "three-debug";
return {
plugins: [ plugins: [
react(), react(),
saveMapPlugin(), saveMapPlugin(),
@@ -644,8 +650,22 @@ export default defineConfig({
validateDialoguesPlugin(), validateDialoguesPlugin(),
], ],
resolve: { resolve: {
alias: { alias: [
"@": fileURLToPath(new URL("./src", import.meta.url)), {
find: "@",
replacement: fileURLToPath(new URL("./src", import.meta.url)),
}, },
...(isThreeDebug
? [{ find: /^three$/, replacement: THREE_SOURCE_ENTRY }]
: []),
],
}, },
...(isThreeDebug
? {
optimizeDeps: {
exclude: ["three"],
},
}
: {}),
};
}); });