From 2ce1c55f692b6fd8a534b0a65be680f22f4cf571 Mon Sep 17 00:00:00 2001 From: German Khokhlov Date: Sat, 17 Oct 2026 01:09:58 +0400 Subject: [PATCH] build: the QA probe stays out of production builds src/app/qaProbe.js was statically imported by standalone/application.js and shipped in the main chunk (+639 B gzip). It now loads with import() behind import.meta.env.DEV at the import site: production builds drop it (main chunk 2,890,982 -> 2,889,432 B), the dev server still installs window.__godsEyeView.layers (checked headless). Phase-4 merge review item 1. --- src/standalone/application.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/standalone/application.js b/src/standalone/application.js index 6cf95e771..f915ab938 100644 --- a/src/standalone/application.js +++ b/src/standalone/application.js @@ -8,7 +8,6 @@ import { createStandaloneData } from './data.js'; import { createStandaloneTools } from './tools.js'; import { createGoogleTokenSource } from '../maps/googleTokens.js'; import { resolveEngineKind } from '../app/engineChoice.js'; -import { createQaProbe } from '../app/qaProbe.js'; // The existing controls and layer catalog contain page-scoped state. let constructed = false; @@ -112,9 +111,12 @@ export function createStandaloneApplication({ placeSearch, voice, }); - // The engine-neutral QA probe on the debug handle (src/app/qaProbe.js). + // The engine-neutral QA probe on the debug handle (src/app/qaProbe.js), + // on the dev server only: import.meta.env.DEV at the import site, so + // production builds drop it. const debug = globalThis.window?.__godsEyeView; - if (debug) { + if (import.meta.env?.DEV && debug) { + const { createQaProbe } = await import('../app/qaProbe.js'); const probe = createQaProbe({ engine: context.scene.engine, dataManager: context.data.dataManager,