Commit f23baf11 by xzyfer

The watch should watch indented syntax files too

This fixes a bug that prevented the watcher from triggering file
compilations on changes to .sass file.

Fixes #1075
parent ef7d11ef
......@@ -225,7 +225,7 @@ function getOptions(args, options) {
function watch(options, emitter) {
var watch = [];
var graphOptions = { loadPaths: options.includePath };
var graphOptions = { loadPaths: options.includePath, extensions: ['scss', 'sass', 'css'] };
var graph;
if (options.directory) {
graph = grapher.parseDir(options.directory, graphOptions);
......
......@@ -288,7 +288,7 @@ describe('cli', function() {
}, 500);
});
it('should watch the full sass dep tree for a single file', function(done) {
it('should watch the full scss dep tree for a single file', function(done) {
var src = fixture('watching/index.scss');
var foo = fixture('watching/foo.scss');
......@@ -311,6 +311,29 @@ describe('cli', function() {
}, 500);
});
it('should watch the full sass dep tree for a single file', function(done) {
var src = fixture('watching/index.sass');
var foo = fixture('watching/bar.sass');
fs.writeFileSync(foo, '');
var bin = spawn(cli, [
'--output-style', 'compressed',
'--watch', src
]);
bin.stdout.setEncoding('utf8');
bin.stdout.once('data', function(data) {
assert(data.trim() === 'body{background:white}');
bin.kill();
done();
});
setTimeout(function() {
fs.appendFileSync(foo, 'body\n\tbackground: white\n');
}, 500);
});
it('should watch whole directory', function(done) {
var destDir = fixture('watching-css-out/');
var srcDir = fixture('watching-dir/');
......
body
background: white
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