Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Add descendent files to watched files
Browse files Browse the repository at this point in the history
Fixes #1731
  • Loading branch information
marvinhagemeister committed Oct 11, 2016
1 parent 04e74f4 commit c1898f6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bin/node-sass
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c1898f6

Please sign in to comment.