I'm having an issue with the sequence of tasks running in my file watching code. Although I have specified that the 'build-dev-mainjs' task should run first, followed by $.livereload.changed
, it seems to be happening in the opposite order.
// synchronous
gulp.task('build-dev-mainjs', ['jshint', 'clean'], function() {
console.log('inmaindevjs');
return gulp.src(['app/client/scripts/*.js',
'app/client/bower_components/**/*.js'])
.pipe(gulp.dest('public/assets/scripts'));
});
gulp.watch('app/client/scripts/**/*.js', ['build-dev-mainjs'])
.on('change', $.livereload.changed);
The reason for this desired behavior is that after each change, the build-dev-mainjs task is supposed to copy the files into the dist folder, from which the server then serves the files.