统一本地字体资源引用
This commit is contained in:
@@ -41,6 +41,19 @@ const copyStaticSubtree = (subtree) => {
|
||||
console.log(`Copied ${subtree} assets to ${path.relative(projectRoot, targetDir)}`)
|
||||
}
|
||||
|
||||
const copyPublicStaticSubtree = (subtree) => {
|
||||
const sourceDir = path.join(projectRoot, 'public', 'static', subtree)
|
||||
const targetDir = path.join(h5Root, 'static', subtree)
|
||||
|
||||
if (!fs.existsSync(sourceDir)) {
|
||||
throw new Error(`Public static assets not found: ${sourceDir}`)
|
||||
}
|
||||
|
||||
fs.rmSync(targetDir, { recursive: true, force: true })
|
||||
copyDirectory(sourceDir, targetDir)
|
||||
console.log(`Copied public static ${subtree} assets to ${path.relative(projectRoot, targetDir)}`)
|
||||
}
|
||||
|
||||
const copyStaticFile = (fileName) => {
|
||||
const sourceFile = path.join(projectRoot, 'static', fileName)
|
||||
const targetFile = path.join(h5Root, 'static', fileName)
|
||||
@@ -61,6 +74,7 @@ copyStaticSubtree('sgs-map-sdk')
|
||||
copyStaticSubtree('three')
|
||||
copyStaticFile('exhibit-placeholder.jpg')
|
||||
copyStaticFile('hall-placeholder.jpg')
|
||||
copyPublicStaticSubtree('Fonts')
|
||||
|
||||
if (fs.existsSync(faviconSource)) {
|
||||
fs.copyFileSync(faviconSource, faviconTarget)
|
||||
|
||||
Reference in New Issue
Block a user