-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtsdown.config.ts
More file actions
28 lines (21 loc) · 918 Bytes
/
tsdown.config.ts
File metadata and controls
28 lines (21 loc) · 918 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 { defineConfig } from "tsdown";
export default defineConfig({
// Single public entry — everything flows through src/index.ts
entry: ["src/index.ts"],
// Ship both ESM (for bundlers / modern Node / Bun) and CJS (for older
// Node consumers that still require() packages).
format: ["esm", "cjs"],
// Generate .d.ts + .d.cts declaration files so TypeScript consumers
// get types for whichever module format they load.
dts: true,
// Wipe dist/ before each build so stale artefacts never ship.
clean: true,
// Inline sourcemaps for debuggability; consumers can strip them later.
sourcemap: true,
// Drop dead code on the ESM output — keeps the bundle small for
// wrappers that only use a subset of plugins.
treeshake: true,
// Targets modern runtimes that have native fetch, Request, Response,
// and structuredClone. Adjust down if older Node support is needed.
target: "es2020",
});