diff --git a/src/cli.js b/src/cli.js index 4bb35f76c12a..ad6cdf1c710e 100644 --- a/src/cli.js +++ b/src/cli.js @@ -875,8 +875,10 @@ 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() + if (process.stdin.isTTY) { + process.stdin.on('end', () => process.exit(0)) + process.stdin.resume() + } startWatcher() } else { buildOnce()