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.
This commit is contained in:
German Khokhlov committed 2026-10-17 01:09:58 +04:00
1 parent 7f13ef4a87
commit 2ce1c55f69
1 file changed
+5 -3
+5 -3
View File
@@ -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,