-
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) · 1014 Bytes
/
Copy pathtsup.config.ts
File metadata and controls
34 lines (33 loc) · 1014 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";
export default defineConfig([
{
/*
* Core must stay importable with zero node builtins. `platform: "neutral"`
* gives esbuild no node fallback to resolve against, so an accidental
* `import "node:fs"` here fails the build instead of shipping silently.
*/
entry: ["src/index.ts"],
format: ["esm", "cjs"],
platform: "neutral",
target: "es2022",
dts: true,
sourcemap: true,
clean: true,
},
{
entry: { "node/index": "src/node/index.ts" },
format: ["esm", "cjs"],
platform: "node",
target: "node18",
dts: true,
sourcemap: true,
clean: false,
/*
* Must stay external and self-referenced by package name (not a relative
* import), never inlined: CJS has no code splitting, so bundling core into
* this entry would produce a second, distinct `OntologyStore` class and
* break `instanceof` across the two entry points.
*/
external: ["@diffbot/typescript"],
},
]);