From 3d282702b6988fc8410e4e44ab9dd1b6fde78146 Mon Sep 17 00:00:00 2001 From: Timmo Verlaan Date: Wed, 4 Nov 2020 17:38:40 +0100 Subject: [PATCH] exit watch process on EOF / Ctrl-D --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index edc7a3f..c54c1be 100644 --- a/index.js +++ b/index.js @@ -92,6 +92,9 @@ Promise.resolve() }) .then((results) => { if (argv.watch) { + process.stdin.on('end', () => process.exit(0)); + process.stdin.resume(); + const printMessage = () => printVerbose(chalk.dim('\nWaiting for file changes...')) const watcher = chokidar.watch(input.concat(dependencies(results)), {