Files
snapcad-studio/scripts/copy-ifc-wasm.mjs
T
Enes Yakıştır ee28672e23
Build and Push Docker Images / build (push) Canceled after 0s
Desktop Release / Build linux desktop (push) Canceled after 0s
Desktop Release / Build windows desktop (push) Canceled after 0s
Desktop Release / Attach packages to release (push) Canceled after 0s
Desktop Release / Build macos desktop (push) Canceled after 0s
CI / Typecheck and unit tests (push) Canceled after 0s
release: SnapCAD Studio 1.0.10 (desktop menuler, macOS kisayollari, YakNet SSO)
2026-11-12 10:12:35 +03:00

22 lines
910 B
JavaScript

// 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/");