-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsdown.config.ts
More file actions
53 lines (51 loc) · 1.38 KB
/
tsdown.config.ts
File metadata and controls
53 lines (51 loc) · 1.38 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
import { readFileSync } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { defineConfig } from "tsdown";
const repoRoot = path.dirname(fileURLToPath(import.meta.url));
const sourceRoot = path.join(repoRoot, "packages", "x402-proxy");
const { version } = JSON.parse(readFileSync(path.join(sourceRoot, "package.json"), "utf-8")) as {
version: string;
};
export default defineConfig([
{
entry: {
index: path.join(sourceRoot, "src/index.ts"),
},
outDir: path.join(sourceRoot, ".artifacts/cli/dist"),
format: ["esm"],
fixedExtension: false,
dts: true,
clean: true,
treeshake: true,
},
{
entry: {
"bin/cli": path.join(sourceRoot, "src/bin/cli.ts"),
},
outDir: path.join(sourceRoot, ".artifacts/cli/dist"),
format: ["esm"],
fixedExtension: false,
dts: false,
clean: false,
treeshake: true,
banner: { js: "#!/usr/bin/env node" },
define: { __VERSION__: JSON.stringify(version) },
},
{
entry: {
"openclaw/plugin": path.join(sourceRoot, "src/openclaw/plugin.ts"),
},
outDir: path.join(sourceRoot, ".artifacts/openclaw/dist"),
format: ["esm"],
fixedExtension: false,
dts: true,
clean: true,
treeshake: true,
unbundle: true,
deps: {
skipNodeModulesBundle: true,
},
define: { __VERSION__: JSON.stringify(version) },
},
]);