Unverified Commit a3ae9667 by Michael Mifsud Committed by GitHub

Merge pull request #2151 from sass/more-watcher-fixes

Fix watching of entry points
parents e3ca0757 2326b5f4
......@@ -250,8 +250,6 @@ function watch(options, emitter) {
});
};
watcher.reset(options);
var gaze = new Gaze();
gaze.add(watcher.reset(options));
gaze.on('error', emitter.emit.bind(emitter, 'error'));
......
var grapher = require('sass-graph'),
clonedeep = require('lodash.clonedeep'),
path = require('path'),
config = {},
watcher = {},
graph = null;
......@@ -30,8 +31,14 @@ watcher.changed = function(absolutePath) {
this.reset();
if (absolutePath && path.basename(absolutePath)[0] !== '_') {
files.changed.push(absolutePath);
}
graph.visitAncestors(absolutePath, function(parent) {
files.changed.push(parent);
if (path.basename(parent)[0] !== '_') {
files.changed.push(parent);
}
});
graph.visitDescendents(absolutePath, function(child) {
......@@ -50,7 +57,7 @@ watcher.added = function(absolutePath) {
this.reset();
if (Object.keys(graph.index).indexOf(absolutePath) !== -1) {
if (Object.keys(graph.index).indexOf(absolutePath) === -1) {
files.added.push(absolutePath);
}
......@@ -69,7 +76,9 @@ watcher.removed = function(absolutePath) {
};
graph.visitAncestors(absolutePath, function(parent) {
files.changed.push(parent);
if (path.basename(parent)[0] !== '_') {
files.changed.push(parent);
}
});
if (Object.keys(graph.index).indexOf(absolutePath) !== -1) {
......
@import "partials/three";
.one {
color: darkred;
}
@import "partials/three";
.two {
color: darkblue;
}
@import "partials/two";
.two {
color: blue;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment