forked from rivet-dev/rivet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsup.base.ts
More file actions
28 lines (26 loc) · 720 Bytes
/
tsup.base.ts
File metadata and controls
28 lines (26 loc) · 720 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
import type { Options } from "tsup";
const FAST_BUILD = process.env.FAST_BUILD === "1";
export default {
target: "node16",
platform: "node",
format: ["cjs", "esm"],
sourcemap: true,
clean: true,
// DTS takes the longest time, so we skip it if doing a fast build
dts: FAST_BUILD
? false
: {
compilerOptions: {
skipLibCheck: true,
resolveJsonModule: true,
},
},
minify: false,
// IMPORTANT: Splitting is required to fix a bug with ESM (https://github.com/egoist/tsup/issues/992#issuecomment-1763540165)
splitting: true,
skipNodeModulesBundle: true,
publicDir: true,
external: [/^node:.*/],
// Required to replace `import.meta.ur.` with CJS shims
shims: true,
} satisfies Options;