/** @file Bundle the supervisor and the OCapN vat runtime for workerd (see config.capnp). */ import { build } from "esbuild"; const common = { bundle: true, format: "esm", platform: "neutral", mainFields: ["module", "main"], conditions: ["workerd", "import"], external: ["cloudflare:workers", "node:*"], logLevel: "warning", }; await build({ ...common, entryPoints: ["supervisor.js"], outfile: "dist/supervisor.js", external: [...common.external, "vat-runtime.txt"] }); // loaded as text, beside the vat's own module (vat.js) await build({ ...common, entryPoints: ["vat-runtime.js"], outfile: "dist/vat-runtime.js", external: [...common.external, "./vat.js"] });