build: add Navara for the experimental engine

Pins @navaramap/three and @navaramap/three-default-plugin 0.2.1 with
their peers three 0.185.1 and postprocessing 6.39.4 (mapillary-js keeps
its own nested three 0.134). The dev server leaves the Navara packages
and their wasm workers out of dependency pre-bundling so wasm-bindgen
resolves its .wasm next to the package. Nothing imports Navara yet: the
Cesium-mode main chunk is byte-identical (2,837,992 bytes, same hash).
This commit is contained in:
German Khokhlov committed 2026-10-15 19:03:32 +04:00
1 parent 6dbd9c983e
commit b6ac0e9c99
4 files changed
+1146 -5

No files matched your search

+12
View File
@@ -85,6 +85,18 @@ export function createBrowserViteConfig({
// Loaded on demand when the first street-level image opens. // Loaded on demand when the first street-level image opens.
'mapillary-js', 'mapillary-js',
], ],
// Navara's wasm-bindgen glue loads new URL('x_bg.wasm', import.meta.url)
// and its workers by URL; both must resolve next to the package's own
// files, not inside .vite/deps. Dev server only: the experimental
// Navara engine is a dynamic import outside the Cesium-mode bundle.
exclude: [
'@navaramap/three',
'@navaramap/three-default-plugin',
'@navaramap/engine',
'@navaramap/engine-api',
'@navaramap/engine-worker',
'@navaramap/engine-font-worker',
],
}, },
server: { server: {
host: host || 'localhost', host: host || 'localhost',
+1116 -4
View File
File diff suppressed because it is too large. Load diff
+5 -1
View File
@@ -58,13 +58,17 @@
"@jtarrio/webrtlsdr": "^3.0.6", "@jtarrio/webrtlsdr": "^3.0.6",
"@mapbox/vector-tile": "^3.0.0", "@mapbox/vector-tile": "^3.0.0",
"@meri-imperiumi/eccodes-wasm": "^2.48.2", "@meri-imperiumi/eccodes-wasm": "^2.48.2",
"@navaramap/three": "0.2.1",
"@navaramap/three-default-plugin": "0.2.1",
"cesium": "^1.124.0", "cesium": "^1.124.0",
"egm96-universal": "^1.1.1", "egm96-universal": "^1.1.1",
"hls.js": "^1.7.3", "hls.js": "^1.7.3",
"mapillary-js": "^4.1.2", "mapillary-js": "^4.1.2",
"mgrs": "^2.1.0", "mgrs": "^2.1.0",
"pbf": "^5.1.2", "pbf": "^5.1.2",
"satellite.js": "^6.0.2" "postprocessing": "6.39.4",
"satellite.js": "^6.0.2",
"three": "0.185.1"
}, },
"devDependencies": { "devDependencies": {
"prettier": "3.9.6", "prettier": "3.9.6",
+13
View File
@@ -229,3 +229,16 @@ test('the CSP admits the event media embeds and the Maps JavaScript API, and no
// X posts load in X's own frames. // X posts load in X's own frames.
assert.ok(frames.includes('https://platform.twitter.com')); assert.ok(frames.includes('https://platform.twitter.com'));
}); });
test('the dev server leaves Navara and its wasm workers out of dependency pre-bundling', () => {
const { optimizeDeps } = createBrowserViteConfig({});
for (const name of [
'@navaramap/three',
'@navaramap/three-default-plugin',
'@navaramap/engine',
'@navaramap/engine-api',
'@navaramap/engine-worker',
'@navaramap/engine-font-worker',
])
assert.ok(optimizeDeps.exclude?.includes(name), name);
});