diff --git a/src/cli.js b/src/cli.js index 5d33eafa495e..9a79ce3f96e2 100644 --- a/src/cli.js +++ b/src/cli.js @@ -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()