chore: add three devtools debug mode

This commit is contained in:
Tom Boullay
2026-05-12 11:45:43 +02:00
parent b04aa95966
commit e65ad62b76
2 changed files with 34 additions and 13 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",
+33 -13
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,18 +637,35 @@ function resolvePublicPath(publicPath: string): string | null {
return resolvedPath; return resolvedPath;
} }
export default defineConfig({ export default defineConfig(({ mode }) => {
plugins: [ const isThreeDebug = mode === "three-debug";
react(),
saveMapPlugin(), return {
saveSrtPlugin(), plugins: [
saveDialogueManifestPlugin(), react(),
saveCinematicManifestPlugin(), saveMapPlugin(),
validateDialoguesPlugin(), saveSrtPlugin(),
], saveDialogueManifestPlugin(),
resolve: { saveCinematicManifestPlugin(),
alias: { validateDialoguesPlugin(),
"@": fileURLToPath(new URL("./src", import.meta.url)), ],
resolve: {
alias: [
{
find: "@",
replacement: fileURLToPath(new URL("./src", import.meta.url)),
},
...(isThreeDebug
? [{ find: /^three$/, replacement: THREE_SOURCE_ENTRY }]
: []),
],
}, },
}, ...(isThreeDebug
? {
optimizeDeps: {
exclude: ["three"],
},
}
: {}),
};
}); });