Files
zap-es/build.config.ts
Victor BerchetandGitHub e1d585a1c1 refactor: make sure runtimes beside node are supported (#42)
The debug code pulls `node:fs` and `node:child_process` which are not supported on all runtimes.
Moving the debug code outside of the main barrel allows supporting more runtime (i.e. workerd)
Also use a local implementation of utf8Encode to drop the dependency on `node:util`.
2025-06-06 08:03:29 +02:00

25 lines
671 B
TypeScript

import { defineBuildConfig } from "unbuild";
import { fileURLToPath } from "node:url";
export default defineBuildConfig({
declaration: true,
entries: [
"./src/index.ts",
"./src/compiler/index.ts",
"./src/compiler/capnpc-js.ts",
"./src/compiler/capnpc-dts.ts",
"./src/compiler/capnpc-ts.ts",
"./src/debug/index.ts",
...["cpp", "persistent", "rpc-twoparty", "rpc", "schema", "ts"].map(
(n) => `./src/capnp/${n}.ts`,
),
],
alias: {
"capnp-es": fileURLToPath(new URL("src/index.ts", import.meta.url)),
},
hooks: {
"rollup:options"(_ctx, rollupOptions) {
rollupOptions.external = ["typescript"];
},
},
});