release: bump version to 0.85.0
ci / backend (push) Waiting to run
ci / frontend (push) Waiting to run

This commit is contained in:
linkong committed 2026-12-06 22:47:23 +08:00
1 parent 30b44ec00d
commit 1c0066edc6
223 files changed
+30277 -340

No files matched your search

+27 -1
View File
@@ -17,6 +17,7 @@ export function earthRuntimePlugin(root) {
const require = createRequire(join(root, 'package.json'))
const mediaPipePkgDir = dirname(require.resolve('@mediapipe/tasks-vision/package.json'))
const threeModulePath = join(dirname(require.resolve('three')), 'three.module.js')
const maplibreDistDir = join(dirname(require.resolve('maplibre-gl/package.json')), 'dist')
let outDir = 'dist'
let compilation = null
@@ -24,7 +25,10 @@ export function earthRuntimePlugin(root) {
if (compilation) return compilation
compilation = compileEarthRuntime({
earthDir: earth,
importMapOverrides: { three: './vendor/three.module.js' },
importMapOverrides: {
three: './vendor/three.module.js',
'maplibre-gl': './vendor/maplibre-gl.mjs',
},
}).catch((error) => {
compilation = null
throw error
@@ -52,6 +56,22 @@ export function earthRuntimePlugin(root) {
res.end(readFileSync(threeModulePath))
return
}
if (url === '/earth/vendor/maplibre-gl.mjs' || url === '/earth/vendor/maplibre-gl-worker.mjs') {
const filePath = join(maplibreDistDir, basename(url))
if (!existsSync(filePath)) return next()
res.setHeader('Cache-Control', 'no-cache')
res.setHeader('Content-Type', 'text/javascript; charset=utf-8')
res.end(readFileSync(filePath))
return
}
if (url === '/earth/vendor/maplibre-gl.css') {
const filePath = join(maplibreDistDir, 'maplibre-gl.css')
if (!existsSync(filePath)) return next()
res.setHeader('Cache-Control', 'no-cache')
res.setHeader('Content-Type', 'text/css; charset=utf-8')
res.end(readFileSync(filePath))
return
}
if (url === '/earth/vendor/mediapipe/vision_bundle.mjs') {
const filePath = join(mediaPipePkgDir, 'vision_bundle.mjs')
if (!existsSync(filePath)) return next()
@@ -109,6 +129,12 @@ export function earthRuntimePlugin(root) {
if (existsSync(threeModulePath)) {
cpSync(threeModulePath, join(targetThreeDir, 'three.module.js'))
}
for (const fileName of ['maplibre-gl.mjs', 'maplibre-gl-worker.mjs', 'maplibre-gl.css']) {
const src = join(maplibreDistDir, fileName)
if (existsSync(src)) {
cpSync(src, join(targetThreeDir, fileName))
}
}
const targetMediaPipeDir = resolve(root, outDir, 'earth/vendor/mediapipe')
mkdirSync(targetMediaPipeDir, { recursive: true })
const bundleSrc = join(mediaPipePkgDir, 'vision_bundle.mjs')