2026-04-27 17:47:17 -04:00
|
|
|
import { defineConfig } from "tsup";
|
|
|
|
|
|
2026-07-07 23:53:44 -04:00
|
|
|
/** `yaml` uses dynamic require internally and breaks when inlined into ESM. */
|
|
|
|
|
const bundledDatabaseExternals = ["yaml"] as const;
|
|
|
|
|
|
2026-04-27 17:47:17 -04:00
|
|
|
export default defineConfig({
|
|
|
|
|
entry: ["src/index.ts"],
|
|
|
|
|
format: ["esm"],
|
|
|
|
|
dts: true,
|
|
|
|
|
// Bundle workspace packages into the output so the runtime image doesn't try
|
|
|
|
|
// to resolve `@tasks/database` / `@tasks/shared` (which export raw .ts files)
|
|
|
|
|
// at import time — Node 20 cannot load .ts. Third-party deps stay external
|
|
|
|
|
// and are installed via the regular node_modules layer in the runtime image.
|
|
|
|
|
noExternal: [/^@tasks\//],
|
2026-07-07 23:53:44 -04:00
|
|
|
external: [...bundledDatabaseExternals],
|
2026-04-27 17:47:17 -04:00
|
|
|
target: "node20",
|
|
|
|
|
platform: "node",
|
|
|
|
|
clean: true,
|
|
|
|
|
});
|