Skip to content

Commit c094769

Browse files
committed
fix(watch): fixed rebuilding CSS on SASS change
1 parent 594233d commit c094769

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"src/app/**/*.tpl.html",
1414
"src/common/**/*.tpl.html"
1515
],
16-
"sass" : "src/+(sass|app|common)/**/*",
16+
"sass" : "src/+(sass|app|common)/**/*.scss",
1717
"assets" : "src/assets/**",
1818
"html" : "src/index.html",
1919
"tests" : "src/+(app|common)/**/*.spec.js"

gulpfile.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,12 @@ gulp.task('watch', ['styles:sass', 'scripts:lint', 'scripts:cacheTpls', 'assets:
291291
});
292292

293293
// watch for SASS changes
294-
var sassWatcher = gulp.watch(config.paths.sass, ['styles:sass:imports']);
295-
sassWatcher.on('change', function (event) {
296-
if (event.path.lastIndexOf('.scss') === event.path.length - 5) {
294+
var runSequence = require('run-sequence');
295+
gulp.watch(config.paths.sass, function (event) {
296+
runSequence('styles:sass:imports', function () {
297297
var files = config.build + '/assets/' + pkg.name + '-' + pkg.version + '.scss';
298298
return fnSass(files).pipe(plugins.livereload(server));
299-
}
299+
});
300300
});
301301

302302
gulp.watch(config.paths.assets, function (event) {

0 commit comments

Comments
 (0)