mirror of
https://github.com/hanzoai/zap-es.git
synced 2026-11-03 04:35:49 +00:00
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`.
25 lines
671 B
TypeScript
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"];
|
|
},
|
|
},
|
|
});
|