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

Switch to Chokidar. #844

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ install:
- node --version
- npm --version
- git submodule update --init --recursive
- ps: npm install --msvs_version=2013
- npm install --msvs_version=2013
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just remove ps: prefix, not the entire statement.

- npm install --msvs_version=2013


test_script: npm test
13 changes: 6 additions & 7 deletions bin/node-sass
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var Emitter = require('events').EventEmitter,
forEach = require('async-foreach').forEach,
Gaze = require('gaze'),
chokidar = require('chokidar'),
grapher = require('sass-graph'),
meow = require('meow'),
util = require('util'),
Expand Down Expand Up @@ -201,18 +201,17 @@ function getOptions(args, options) {
function watch(options, emitter) {
var src = options.directory ? path.join(options.directory, globPattern(options)) : options.src;
var graph = grapher.parseDir(path.resolve(path.dirname(src)), { loadPaths: options.includePath });
var watch = [];
var paths = [];

// Add all files to watch list
for (var i in graph.index) {
watch.push(i);
paths.push(i);
}

var gaze = new Gaze();
gaze.add(watch);
gaze.on('error', emitter.emit.bind(emitter, 'error'));
var watcher = chokidar.watch(paths);
watcher.on('error', emitter.emit.bind(emitter, 'error'));

gaze.on('changed', function(file) {
watcher.on('change', function(file) {
var files = [file];
graph.visitAncestors(file, function(parent) {
files.push(parent);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"dependencies": {
"async-foreach": "^0.1.3",
"chalk": "^1.0.0",
"gaze": "^0.5.1",
"chokidar": "^1.0.1",
"get-stdin": "^4.0.1",
"glob": "^5.0.3",
"meow": "^3.1.0",
Expand Down