feat: use wireit watch mode when building commons #10407
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.
After switching to the incremental build mode of
tsc, it improved build times quite significantly, but this introduced the issue of stale build artifacts not being cleaned up when switching between branches. The--watchmode oftscdoes not have any support for cleaning stale build files. This PR introduceswireitinto the build pipeline which supports cleaning up stale build when some file has been removed.buildcommand is now controlled viawireit. When new files are added or existing files are changed, we still get the benefits of incremental builds. But when some existing file is deleted, the build folder gets cleaned up.build:watchcommand uses thebuildcommand with wireit's watch mode.test:compilationcommand is similarly controlled viawireitas there are build artifacts which need to be cleaned up due to usingtsc -bcommand.N.B.: Currently
wireitis giving the following warning when running thebuild:watchcommandWe can ignore that as it does not affect us and should get removed with the
pnpmmigration #9658