From c1bb4fed714d3dcf0aaafea56aff334317680064 Mon Sep 17 00:00:00 2001 From: OvermindDL1 Date: Wed, 19 Jul 2017 12:02:06 -0600 Subject: [PATCH] Activate stdin handler processing The `close` handler when `stdin` is `end`ed is not being called. Calling `resume()` on `process.stdin` will enable that handler so it will be called properly. It should 'probably' be called earlier in the program, perhaps at the very start, but if it spools up fast enough it should not matter, and this is the same place similar code in other projects places it as well. --- src/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.js b/src/index.js index dff48a0..6d3ac77 100644 --- a/src/index.js +++ b/src/index.js @@ -212,6 +212,8 @@ export default function watch ( rollup, options ) { // in case we ever support stdin! process.stdin.on('end', close); + // Activate handler processing on stdin so `close` will be called properly + process.stdin.resume(); return watcher; }