Skip to content

Commit 838b83e

Browse files
authored
fix(types): Update tsup configuration to conditionally generate declarations based on watch mode (#6683)
1 parent cda5d7b commit 838b83e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.changeset/green-dingos-flow.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

packages/types/tsup.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import { defineConfig } from 'tsup';
22

3-
export default defineConfig(() => {
3+
export default defineConfig(overrideOptions => {
44
return {
55
entry: {
66
index: 'src/index.ts',
77
},
8+
onSuccess: overrideOptions.watch ? 'pnpm build:declarations' : undefined,
89
minify: false,
910
clean: true,
1011
sourcemap: true,
1112
format: ['cjs', 'esm'],
1213
legacyOutput: true,
13-
dts: true,
14+
dts: !overrideOptions.watch,
1415
};
1516
});

0 commit comments

Comments
 (0)