build: name the lazy Navara engine chunk navara-engine

chunkFileNames names the chunk holding src/globe/navara
navara-engine-[hash].js; chunking is unchanged (manualChunks would pull
modules shared with the Cesium entry into it and make the entry import
it). The Cesium main chunk stays 2,849,217 B.
This commit is contained in:
German Khokhlov committed 2026-10-15 21:27:57 +04:00
1 parent 64d3297301
commit 8270172086
3 files changed
+56 -2

No files matched your search

+6 -2
View File
@@ -3,7 +3,7 @@ import cesium from 'vite-plugin-cesium';
import { DEFAULT_ALLOWED_HOSTS, hostCheckPlugin } from './allowedHosts.js';
import { embedFramingPlugin } from './embed-framing.js';
import { panelBuildPlugin } from './panel.js';
import { navaraWorkerAssets } from './navaraAssets.js';
import { navaraChunkFileNames, navaraWorkerAssets } from './navaraAssets.js';
/**
* Content-Security-Policy for every document the dev/preview server serves.
@@ -130,7 +130,11 @@ export function createBrowserViteConfig({
chunkSizeWarningLimit: 1500,
// Build only: the wasm Navara's workers load by name (the Navara
// engine is a separate chunk loaded on ?engine=navara).
rollupOptions: { plugins: [navaraWorkerAssets()] },
// The lazy chunk with the Navara engine is named navara-engine.
rollupOptions: {
plugins: [navaraWorkerAssets()],
output: { chunkFileNames: navaraChunkFileNames },
},
},
};
}