提交室内导览交互与讲解优化

This commit is contained in:
lyf
2026-06-14 23:48:13 +08:00
parent a7c1879f60
commit feb7310a46
33 changed files with 3257 additions and 361 deletions

View File

@@ -2,9 +2,7 @@ const fs = require('node:fs')
const path = require('node:path')
const projectRoot = path.resolve(__dirname, '..')
const sourceDir = path.join(projectRoot, 'static', 'nav-assets')
const h5Root = path.join(projectRoot, 'dist', 'build', 'h5')
const targetDir = path.join(h5Root, 'static', 'nav-assets')
const faviconSource = path.join(projectRoot, 'public', 'favicon.svg')
const faviconTarget = path.join(h5Root, 'favicon.svg')
@@ -12,10 +10,6 @@ if (!fs.existsSync(h5Root)) {
throw new Error(`H5 build output not found: ${h5Root}`)
}
if (!fs.existsSync(sourceDir)) {
throw new Error(`Navigation assets not found: ${sourceDir}`)
}
const copyDirectory = (source, target) => {
fs.mkdirSync(target, { recursive: true })
@@ -34,11 +28,22 @@ const copyDirectory = (source, target) => {
}
}
fs.rmSync(targetDir, { recursive: true, force: true })
copyDirectory(sourceDir, targetDir)
const copyStaticSubtree = (subtree) => {
const sourceDir = path.join(projectRoot, 'static', subtree)
const targetDir = path.join(h5Root, 'static', subtree)
if (!fs.existsSync(sourceDir)) {
throw new Error(`Static assets not found: ${sourceDir}`)
}
fs.rmSync(targetDir, { recursive: true, force: true })
copyDirectory(sourceDir, targetDir)
console.log(`Copied ${subtree} assets to ${path.relative(projectRoot, targetDir)}`)
}
copyStaticSubtree('nav-assets')
copyStaticSubtree('sgs-map-sdk')
if (fs.existsSync(faviconSource)) {
fs.copyFileSync(faviconSource, faviconTarget)
}
console.log(`Copied navigation assets to ${path.relative(projectRoot, targetDir)}`)