From d81ebf1268b46c40bbe40e0fd7c26ead38a629ff Mon Sep 17 00:00:00 2001 From: German Khokhlov Date: Sat, 17 Oct 2026 01:09:58 +0400 Subject: [PATCH] build: the panel build leaves out the initial-chunk guard The MCP panel build inlines every dynamic import into its one script, the Navara mode included, so the guard that keeps Navara out of the app's initial chunks failed it (npm run build:panel was red since d483e589). The panel config filters the guard out, as phase 4 does; a test pins it. build:panel is green and joins the gates. Phase-4 merge review item 2. --- build/panel.js | 6 ++++++ src/tooling/panelBuild.test.mjs | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/build/panel.js b/build/panel.js index e10d0bbca..03610964f 100644 --- a/build/panel.js +++ b/build/panel.js @@ -26,6 +26,12 @@ export function panelBuildConfig(config) { cssCodeSplit: false, rollupOptions: { ...config.build?.rollupOptions, + // The panel inlines every dynamic import into its one script, the + // experimental Navara mode included, so the guard that keeps Navara + // out of the app's initial chunks does not apply here. + plugins: (config.build?.rollupOptions?.plugins ?? []).filter( + (plugin) => plugin?.name !== 'gev-initial-chunk-guard', + ), output: { inlineDynamicImports: true }, }, }, diff --git a/src/tooling/panelBuild.test.mjs b/src/tooling/panelBuild.test.mjs index 0b130167e..0a7e1f364 100644 --- a/src/tooling/panelBuild.test.mjs +++ b/src/tooling/panelBuild.test.mjs @@ -114,3 +114,15 @@ test("Cesium's workers get embedded files from memory and other requests from th globalThis.ProgressEvent = saved.ProgressEvent; } }); + +test('the panel build leaves out the initial-chunk guard (it inlines Navara)', () => { + const kept = { name: 'kept' }; + const config = panelBuildConfig({ + build: { + rollupOptions: { + plugins: [kept, { name: 'gev-initial-chunk-guard' }], + }, + }, + }); + assert.deepEqual(config.build.rollupOptions.plugins, [kept]); +});