Skip to content

Commit 08c1eeb

Browse files
committed
fix(cli): generate .d.ts declaration file for the public API entry point
Enable tsup dts generation for src/exports.ts so that dist/exports.d.ts is produced at build time. The binary entry (index) still skips dts. Work around the `incremental: true` in the base tsconfig that conflicts with tsup's DTS worker by overriding it to false in the tsup config. https://claude.ai/code/session_01SExqFNVoBLQCCAbgAY6LXo
1 parent dec56f1 commit 08c1eeb

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

packages/cli/tsup.config.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@ export default defineConfig({
66
exports: "src/exports.ts",
77
},
88
format: ["esm"],
9-
dts: false,
9+
dts: {
10+
// Only emit declaration files for the public API entry point.
11+
// The `index` (binary) entry doesn't need them.
12+
entry: { exports: "src/exports.ts" },
13+
compilerOptions: {
14+
// `incremental` is incompatible with tsup's DTS worker when not emitting
15+
// to a single file; disable it here.
16+
incremental: false,
17+
},
18+
},
1019
clean: true,
1120
bundle: true,
1221
// External: CommonJS packages that use Node.js built-ins via require()

0 commit comments

Comments
 (0)