build: improve tsup config for turbo #3293
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes the weirdness around running build/dev with explorer.
We have turbo configured to run
build
task for each dep as a prerequisite ofdev
task. Before this change, tsup was configured to only run DTS in a special dev mode usingTSUP_SKIP_DTS
(because DTS generation is slow). This meant that explorer couldn't find the DTS files it expects when building and the build would fail.Instead, we now always build DTS when running a regular tsup build (not watch mode). When tsup is in watch mode, it skips DTS and also skips cleaning, to avoid deleting previously generated DTS files. We need this configured this way otherwise a fast task like building common package would run build + dev, where dev would clean DTS files, then explorer wouldn't be able to find them when it goes to build itself.