Permalink
Browse files

fix(watch): Run sync, to prevent errors from race conditions

  • Loading branch information...
RWOverdijk committed Dec 28, 2015
1 parent 78c2be6 commit 19cc4b0c0896e4384cc09a4b3fd3474a54a6ae6e
Showing with 13 additions and 4 deletions.
  1. +13 −4 build/tasks/watch.js
@@ -1,9 +1,18 @@
var gulp = require('gulp');
var gutil = require('gulp-util');
var gulp = require('gulp');
var gutil = require('gulp-util');
var runSequence = require('run-sequence');
gulp.task('watch', ['clean', 'build-commonjs'], function() {
gulp.task('attach-watchers', function () {
return gulp.watch(['src/**/*', 'test/**/*'], ['build']).on('change', function(file) {
gutil.log('File ' + file + ' was changed, running tasks...');
});
});
gulp.task('watch', function(callback) {
return runSequence(
'clean',
'build-commonjs',
'attach-watchers',
callback
);
});

0 comments on commit 19cc4b0

Please sign in to comment.