Skip to content

Commit c899448

Browse files
committed
Wait for *.d.ts
1 parent 83b1cae commit c899448

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tsup.base.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ const baseConfig: Options & {
115115
// tsup@8.5.0 do not write to output atomically.
116116
// Thus, when building in parallel, some of the files will be emptied.
117117
// We are writing output to /dist.tmp/ and copy everything back to /dist/.
118-
onSuccess: 'mkdir -p ./dist/ && cp ./dist.tmp/* ./dist/',
118+
// "onSuccess" runs before DTS, we need to wait until *.d.ts are emitted.
119+
onSuccess: 'while [ ! -f ./dist.tmp/*.d.ts ]; do sleep 0.2; done; mkdir -p ./dist/ && cp ./dist.tmp/* ./dist/',
119120
outDir: './dist.tmp/'
120121
};
121122

0 commit comments

Comments
 (0)