Clear dist only when the new files are ready #578
Labels
kind: feature
New feature or request
PR welcome
scope: integration
Related to an integration, not necessarily to core (but could influence core)
scope: upstream
Issue in upstream dependency
solution: duplicate
This issue or pull request already exists
solution: unresolved
Issue has been closed by OP but root cause has not necessarily been resolved
topic: monorepo
Related to Lerna monorepos
Current Behavior
When working with a monorepo or with linked package if your package was
build
and you have another bundler using the files indist
. If you eitherbuild
orstart
the compilation it will start by deleting the content ofdist
which does not make bundler happy. In most cases you have to restart the bundler.Example:
Let say you have two packages
app
is acreate-react-app
andb
is usingtsdx
.app
is usingb
.You build the
b
package, then start working onapp
(react-scripts start
inapp
). But then you need to change something inb
so you change some file then buildb
(tsdx build
inb
) at that pointreact-scripts
will crash because one file is missing and it will not recover even when the file are back. You have to restartapp
to make it work again.Desired Behavior
When
tsdx build
is run, it would be nice if thedist
folder was not cleared until the next build output is ready. This wayreact-scripts
and other bundlers would not fail.Suggested Solution
I guess it should be possible to build to a temp directory then move the files at the end.
Who does this impact? Who is this for?
People working with Monorepo or with linked packages.
Describe alternatives you've considered
Just restart the script when it fail but it's annoying...
The text was updated successfully, but these errors were encountered: