// Stages the single-threaded web-ifc WebAssembly runtime (1.68 MB) into // apps/web/public/ifc/ so BIM architectural models (.ifc) can be decoded directly // in the browser and desktop app without COOP/COEP headers or native servers. import { cp, mkdir } from "node:fs/promises"; import { existsSync } from "node:fs"; import { dirname, join } from "node:path"; import { fileURLToPath } from "node:url"; const root = join(dirname(fileURLToPath(import.meta.url)), ".."); const src = join(root, "node_modules", "web-ifc", "web-ifc.wasm"); const destDir = join(root, "apps", "web", "public", "ifc"); if (!existsSync(src)) { console.error(`[copy-ifc-wasm] web-ifc.wasm not found at ${src}. Run \`npm install\` first.`); process.exit(1); } await mkdir(destDir, { recursive: true }); await cp(src, join(destDir, "web-ifc.wasm")); console.log("[copy-ifc-wasm] staged web-ifc.wasm into apps/web/public/ifc/");