Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions packages/ai-provider-bridge/esbuild.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,18 @@ import { build, type BuildOptions, context } from "esbuild";

const watch = process.argv.includes("--watch");

rmSync("dist", { recursive: true, force: true });
rmSync("tsconfig.tsbuildinfo", { force: true });
// Only clean before a one-shot build. In watch mode, this script starts
// concurrently with the two tsc --emitDeclarationOnly --watch processes (see
// the "watch" script), with no guaranteed ordering between them. If a tsc
// watcher completes its first emit before this rmSync runs, the rmSync wipes
// out the .d.ts files it just wrote — and since tsc's watch mode only
// re-emits on source changes (not on missing/deleted outputs), those
// declarations then never come back.
if (!watch) {
rmSync("dist", { recursive: true, force: true });
rmSync("tsconfig.tsbuildinfo", { force: true });
rmSync("tsconfig.positron.tsbuildinfo", { force: true });
}

const entrypoints = [
"src/index.ts",
Expand Down