Skip to content

Commit

Permalink
fix: build breaking on file change (#321)
Browse files Browse the repository at this point in the history
Signed-off-by: Salihu <91833785+SalihuDickson@users.noreply.github.com>
Co-authored-by: salihuDickson <salihudickson@gmail.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored May 27, 2024
1 parent 6366f90 commit 9f47143
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,17 @@ nextTask("Building source", async () => {
);
});
})
.finally(() =>
nextTask("Cleaning up react source", () => {
fs.rmSync(reactDir, {
force: true,
recursive: true,
.finally(() => {
// Skip cleanup if watch mode is enabled to preserve the react source for incremental builds
if (!commanderOpts.watch) {
nextTask("Cleaning up react source", () => {
fs.rmSync(reactDir, {
force: true,
recursive: true,
});
});
})
);
}
});
});

module.exports = {};

0 comments on commit 9f47143

Please sign in to comment.