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]); +});