Skip to content

Skip dist clean in esbuild watch mode#24

Merged
wch merged 1 commit into
mainfrom
fix/esbuild-skip-clean-in-watch
Jul 23, 2026
Merged

Skip dist clean in esbuild watch mode#24
wch merged 1 commit into
mainfrom
fix/esbuild-skip-clean-in-watch

Conversation

@sharon-wang

Copy link
Copy Markdown
Member

The esbuild config deletes dist/ and the tsbuildinfo files at startup so one-shot builds start clean. In watch mode this is a problem: the esbuild script starts at the same time as the two tsc --emitDeclarationOnly --watch processes, with no guaranteed ordering. If a tsc watcher finishes its first emit before the rmSync runs, the clean wipes out the .d.ts files it just wrote. Because tsc's watch mode only re-emits when source changes (not when outputs go missing), those declarations never come back until you touch a source file.

This change only runs the clean for one-shot builds and skips it in watch mode. It also adds tsconfig.positron.tsbuildinfo to the one-shot clean list so both declaration builds start fresh.

@sharon-wang
sharon-wang requested a review from wch July 22, 2026 21:34
@wch

wch commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the fix! I merged in some stuff in to main here too early and this fixes some of the issues.

@wch
wch merged commit 8774094 into main Jul 23, 2026
4 checks passed
@wch
wch deleted the fix/esbuild-skip-clean-in-watch branch July 23, 2026 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants