-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsup.config.ts
More file actions
33 lines (31 loc) · 1.2 KB
/
tsup.config.ts
File metadata and controls
33 lines (31 loc) · 1.2 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
import { defineConfig } from "tsup";
export default defineConfig([
// ── Library (SDK) entry ────────────────────────────────────────────────────
// No shebang — this is imported by SDK consumers as a normal module.
{
entry: { index: "src/index.ts" },
format: ["esm", "cjs"],
dts: true,
clean: true,
sourcemap: true,
shims: true,
outDir: "dist",
target: "node18",
},
// ── CLI entry ──────────────────────────────────────────────────────────────
// Built as CJS to avoid the shebang-in-ESM SyntaxError on Node 24 + Windows.
// When "type": "module" is set, Node treats .js as ESM and rejects the shebang
// as an invalid token. CJS (.cjs) doesn't have this restriction.
{
entry: { cli: "src/cli.ts" },
format: ["cjs"],
outExtension: () => ({ js: ".cjs" }),
dts: false,
clean: false,
sourcemap: false,
shims: true,
banner: { js: "#!/usr/bin/env node" },
outDir: "dist",
target: "node18",
},
]);