From c1898f66d631be890440617765d881f7688d5024 Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Wed, 12 Oct 2016 00:03:01 +0200 Subject: [PATCH] Add descendent files to watched files Fixes #1731 --- bin/node-sass | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bin/node-sass b/bin/node-sass index 81674a454..5e7a164eb 100755 --- a/bin/node-sass +++ b/bin/node-sass @@ -266,9 +266,18 @@ function watch(options, emitter) { gaze.on('changed', function(file) { var files = [file]; + + // descendents may be added, so we need a new graph + graph = buildGraph(options); graph.visitAncestors(file, function(parent) { files.push(parent); }); + + // Add children to watcher + graph.visitDescendents(file, function(child) { + gaze.add(child); + files.push(child); + }); files.forEach(function(file) { if (path.basename(file)[0] !== '_') { renderFile(file, options, emitter);