-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtsup.config.ts
More file actions
40 lines (38 loc) · 1.23 KB
/
Copy pathtsup.config.ts
File metadata and controls
40 lines (38 loc) · 1.23 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
import { defineConfig } from "tsup";
// One build pass for the whole package. Everything is bundled on the neutral
// platform so the output carries no Node assumptions and runs unchanged in Node,
// edge runtimes, and the browser; the only Node-touching code (the node entry and
// the CLI) imports node: built-ins, which stay external on any platform. The CLI
// entry begins with a shebang in its source, which tsup preserves and marks
// executable, so no per-entry banner is needed and a single config can clean the
// output folder once without racing a second pass.
const entry = [
"src/index.ts",
"src/survival/index.ts",
"src/gamma/index.ts",
"src/exponential/index.ts",
"src/weibull/index.ts",
"src/events/index.ts",
"src/predict/index.ts",
"src/advisor/index.ts",
"src/cohort/index.ts",
"src/calculator/index.ts",
"src/adapter/index.ts",
"src/audit/index.ts",
"src/node/index.ts",
"src/edge/index.ts",
"src/cli/index.ts",
];
export default defineConfig({
entry,
format: ["esm", "cjs"],
outDir: "dist",
platform: "neutral",
target: "es2023",
dts: true,
sourcemap: true,
treeshake: true,
clean: true,
splitting: false,
outExtension: ({ format }) => ({ js: format === "cjs" ? ".cjs" : ".js" }),
});