Add project scripts and tooling

This commit is contained in:
moriy
2026-04-28 17:50:42 +08:00
parent f8857edb99
commit b025708b5a
3 changed files with 121 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
import { cpSync, existsSync, mkdirSync, rmSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
const root = dirname(dirname(fileURLToPath(import.meta.url)));
const candidateBuilds = [
join(root, "node_modules", "cesium", "Build", "Cesium"),
join(root, "web-test", "node_modules", "cesium", "Build", "Cesium"),
];
const cesiumBuild = candidateBuilds.find((value) => existsSync(value));
const target = join(root, "web-test", "public", "cesium");
if (!cesiumBuild) {
throw new Error("Cesium package is not installed. Run npm.cmd install first.");
}
mkdirSync(target, { recursive: true });
for (const name of ["Assets", "ThirdParty", "Workers", "Widgets"]) {
const source = join(cesiumBuild, name);
const destination = join(target, name);
rmSync(destination, { recursive: true, force: true });
cpSync(source, destination, { recursive: true });
}
console.log(`Copied Cesium runtime assets to ${target}`);