I have a very minimal gulpfile as follows, with a watch task registered:
var gulp = require(\"gulp\");
var jshint = require(\"gulp-jshint\");
gulp.task(\"lint\"
To add to OverZealous' answer which is correct.
gulp.watch
now allows you to pass a string array as the callback so you can have two separate tasks. For example, hint:watch
and 'hint'.
You can then do something like the following.
gulp.task('hint', function(event){
return gulp.src(sources.hint)
.pipe(plumber())
.pipe(hint())
.pipe(jshint.reporter("default"));
})
gulp.task('hint:watch', function(event) {
gulp.watch(sources.hint, ['hint']);
})
This is only an example though and ideally you'd define this to run on say a concatted dist file.