Abort the watcher if stdin is closed to avoid zombie processes (#4997)

* Abort the watcher if stdin is closed to avoid zombie processes

* Apply suggestions from code review
This commit is contained in:
José Valim 2021-08-23 20:35:28 +02:00 committed by GitHub
parent 4daa86a293
commit b280378c33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -784,6 +784,9 @@ async function build() {
}
if (shouldWatch) {
/* Abort the watcher if stdin is closed to avoid zombie processes */
process.stdin.on('end', () => process.exit(0))
process.stdin.resume()
startWatcher()
} else {
buildOnce()