diff --git a/bin/node-sass b/bin/node-sass index 98967786d..0b8748eb1 100755 --- a/bin/node-sass +++ b/bin/node-sass @@ -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); diff --git a/test/cli.js b/test/cli.js index 1953e8505..18d4a7653 100644 --- a/test/cli.js +++ b/test/cli.js @@ -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/');