#!/usr/bin/env bun /** * Build script for @elizaos/plugin-zai (Node + Browser + CJS). * Orchestration lives in the shared driver; this lists only what differs. */ import { buildPlugin } from "../plugin-build"; const reexport = (from: string) => `export * from "${from}";\nexport { default } from "${from}";\n`; await buildPlugin({ name: "@elizaos/plugin-zai", clean: true, targets: [ { label: "Node", entry: "index.node.ts", outSubdir: "node", target: "node", format: "esm" }, { label: "Browser", entry: "index.browser.ts", outSubdir: "browser", target: "browser", format: "esm", }, { label: "Node (CJS)", entry: "index.node.ts", outSubdir: "cjs", target: "node", format: "cjs", renames: [["index.node.js", "index.node.cjs"]], }, ], dtsProject: "tsconfig.build.json", dtsShims: [ { path: "index.d.ts", content: reexport("./node/index") }, { path: "node/index.d.ts", content: reexport("./index.node") }, { path: "browser/index.d.ts", content: reexport("./index.browser") }, { path: "cjs/index.d.ts", content: reexport("./index.node") }, ], });