Skip to content
1        10        20        30        40        50        60        701// Bundle every browser module once to catch syntax and import errors.2// The two Three.js specifiers are resolved by the browser import map, so they3// are marked external here.45import { rm } from 'node:fs/promises';6import { join } from 'node:path';7import { tmpdir } from 'node:os';89const outdir = join(tmpdir(), 'torment-build-check');10await rm(outdir, { recursive: true, force: true });1112const result = await Bun.build({13  entrypoints: ['./src/main.js'],14  target: 'browser',15  outdir,16  external: ['three', 'three/addons/loaders/GLTFLoader.js'],17  minify: false,18  sourcemap: 'none',19});2021if (!result.success) {22  for (const log of result.logs) console.error(log);23  process.exit(1);24}2526await rm(outdir, { recursive: true, force: true });27console.log('All game modules bundle cleanly.');