Skip to content

Commit

Permalink
Add descendent files to watched files
Browse files Browse the repository at this point in the history
Fixes sass#1731
  • Loading branch information
marvinhagemeister committed Nov 8, 2016
1 parent 2882d6b commit 71b1446
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bin/node-sass
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,17 @@ 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.forEach(function(file) {
if (path.basename(file)[0] !== '_') {
renderFile(file, options, emitter);
Expand Down

0 comments on commit 71b1446

Please sign in to comment.