forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsdown.config.ts
More file actions
45 lines (44 loc) · 1.19 KB
/
Copy pathtsdown.config.ts
File metadata and controls
45 lines (44 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { defineConfig } from "tsdown";
export default defineConfig({
entry: [
"src/index.ts",
"src/v2/index.ts",
"src/v2/express.ts",
"src/v2/hono.ts",
"src/v2/node.ts",
"src/langgraph.ts",
],
format: ["esm", "cjs"],
dts: true,
sourcemap: true,
target: "es2022",
outDir: "dist",
unbundle: true,
banner: ({ format, fileName }) => {
// tsdown/rolldown reorders bare side-effect imports to the end of the entry chunk,
// breaking type-graphql which needs reflect-metadata at load time.
// The _virtual/_rolldown/runtime banner propagates to all output files per format,
// ensuring reflect-metadata is always the first thing that runs.
if (fileName.includes("_virtual/_rolldown/runtime")) {
return format === "cjs"
? 'require("reflect-metadata");'
: 'import "reflect-metadata";';
}
},
external: [
"@ag-ui/langgraph",
"@langchain/core",
"@langchain/openai",
"@langchain/aws",
"@langchain/community",
"@langchain/google-gauth",
"@langchain/langgraph-sdk",
"langchain",
"@anthropic-ai/sdk",
"groq-sdk",
"@whatwg-node/fetch",
"@whatwg-node/server",
"rxjs",
],
exports: true,
});