forked from theDakshJaitly/mex
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsup.config.ts
More file actions
34 lines (33 loc) · 837 Bytes
/
tsup.config.ts
File metadata and controls
34 lines (33 loc) · 837 Bytes
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
import { defineConfig } from "tsup";
/**
* Two-config build:
* - cli → dist/cli.js (shebang banner, no .d.ts; consumed by `bin`)
* - index → dist/index.js + dist/index.d.ts (library entry consumed via `exports`)
*/
export default defineConfig([
{
entry: { cli: "src/cli.ts" },
format: ["esm"],
target: "node20",
outDir: "dist",
clean: true,
splitting: false,
sourcemap: true,
dts: false,
banner: {
js: "#!/usr/bin/env node",
},
},
{
entry: { index: "src/index.ts" },
format: ["esm"],
target: "node20",
outDir: "dist",
// clean: false here — the CLI build above already cleans dist on each run,
// and we don't want the library build to wipe the CLI artifacts.
clean: false,
splitting: false,
sourcemap: true,
dts: true,
},
]);