Skip to content

Commit 28e76de

Browse files
committed
Add comments
1 parent 300202b commit 28e76de

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tsup.base.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,11 @@ const baseConfig: Options & {
117117

118118
// Writing output to /dist.tmp/ and copy everything back to /dist/ for better atomicity.
119119

120-
// "onSuccess" runs before DTS, we need to wait until *.d.ts are emitted.
120+
// "onSuccess" runs in parallel of DTS, we need to wait until *.d.ts are emitted.
121+
// Filed a bug, https://github.com/egoist/tsup/issues/1363.
121122

122123
// All instances of tsup will try to copy at the same time and could fail with "cp: cannot create regular file './dist/...': File exists".
123-
// We will retry.
124+
// We can have multiple config writing to their own folder and copy-merge. But then each config will own their version of `onSuccess`, could be messy.
124125

125126
onSuccess: `while [ -z "$(find ./dist.tmp -name '*.d.ts' -print -quit)" ]; do sleep 0.2; done; mkdir -p ./dist/; until cp ./dist.tmp/* ./dist/; do sleep 0.5; done`,
126127
outDir: './dist.tmp/'

0 commit comments

Comments
 (0)