fix(snowpack): exit process after success #956
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.
Changes
Ensures that the primary node process is exited, which cleans up any associated child processes spawned by it. Without this,
build
(specifically) can hang indefinitely even though it was successful and Snowpack knows it's complete.Screenshots
There's some additional logging in here -- remnants of my hunt to make sure it wasn't a fault of Snowpack elsewhere. For example, the
stopping
is at the cleanup stage of the esbuild plugin.Before
After
Testing
Did not add tests since nothing should be altered by default. The
return
already implied a0
exit code, preventing the finalprocess.exit(1)
from running. By addingprocess.exit(0)
we're basically just redefining the defaults.