forked from openclaw/openclaw
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtsdown.config.ts
More file actions
101 lines (94 loc) 路 2.26 KB
/
Copy pathtsdown.config.ts
File metadata and controls
101 lines (94 loc) 路 2.26 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import { defineConfig } from "tsdown";
const env = {
NODE_ENV: "production",
};
function buildInputOptions(options: { onLog?: unknown; [key: string]: unknown }) {
if (process.env.OPENCLAW_BUILD_VERBOSE === "1") {
return undefined;
}
const previousOnLog = typeof options.onLog === "function" ? options.onLog : undefined;
return {
...options,
onLog(
level: string,
log: { code?: string },
defaultHandler: (level: string, log: { code?: string }) => void,
) {
if (log.code === "PLUGIN_TIMINGS") {
return;
}
if (typeof previousOnLog === "function") {
previousOnLog(level, log, defaultHandler);
return;
}
defaultHandler(level, log);
},
};
}
function nodeBuildConfig(config: Record<string, unknown>) {
return {
...config,
env,
fixedExtension: false,
platform: "node",
inputOptions: buildInputOptions,
};
}
const pluginSdkEntrypoints = [
"index",
"core",
"compat",
"telegram",
"acpx",
"copilot-proxy",
"diagnostics-otel",
"diffs",
"google-gemini-cli-auth",
"llm-task",
"lobster",
"memory-core",
"memory-lancedb",
"minimax-portal-auth",
"open-prose",
"qwen-portal-auth",
"talk-voice",
"test-utils",
"thread-ownership",
"account-id",
"keyed-async-queue",
] as const;
export default defineConfig([
nodeBuildConfig({
entry: "src/index.ts",
}),
nodeBuildConfig({
entry: "src/entry.ts",
}),
nodeBuildConfig({
// Ensure this module is bundled as an entry so legacy CLI shims can resolve its exports.
entry: "src/cli/daemon-cli.ts",
}),
nodeBuildConfig({
entry: "src/infra/warning-filter.ts",
}),
nodeBuildConfig({
// Keep sync lazy-runtime channel modules as concrete dist files.
entry: {
"channels/plugins/actions/telegram": "src/channels/plugins/actions/telegram.ts",
"telegram/audit": "src/telegram/audit.ts",
"telegram/token": "src/telegram/token.ts",
},
}),
...pluginSdkEntrypoints.map((entry) =>
nodeBuildConfig({
entry: `src/plugin-sdk/${entry}.ts`,
outDir: "dist/plugin-sdk",
}),
),
nodeBuildConfig({
entry: "src/extensionAPI.ts",
}),
nodeBuildConfig({
entry: ["src/hooks/bundled/*/handler.ts", "src/hooks/llm-slug-generator.ts"],
}),
]);