So today is my first day playing around with gulp and grunt or any task runner for js. I got to a place where I was able to change my code in my js files and then run the
gulp browserify
this works fine. However it was annoying and I wanted to add a watch to this so that when I make any changes to the scripts, it would automatically run gulp browserify or something and I would not have to do it manually. So here is what I did to my gulp.js
var gulp = require('./gulp')({
});
gulp.task('watch', function() {
// Watch .js files
gulp.watch('jsfolder/**/*.js', ['scripts']);
});
gulp.task('release', ['build']);
gulp.task('build', ['scripts', 'browserify']);
gulp.task('default', ['watch']);
so when I do this
gulp watch
and when I save my changes it gives me
14:37:21] Starting 'clean'...
[14:37:21] Finished 'clean' after 3.18 ms
[14:37:21] Starting 'concat'...
[14:37:21] Finished 'concat' after 263 μs
[14:37:21] Starting 'checksum'...
[14:37:21] Finished 'checksum' after 19 ms
[14:37:21] Starting 'scripts'...
[14:37:21] Finished 'scripts' after 455 μs
[14:38:41] Starting 'clean'...
[14:38:41] Finished 'clean' after 2.9 ms
[14:38:41] Starting 'concat'...
[14:38:41] Finished 'concat' after 218 μs
[14:38:41] Starting 'checksum'...
[14:38:41] Finished 'checksum' after 18 ms
[14:38:41] Starting 'scripts'...
[14:38:41] Finished 'scripts' after 302 μs
but my changes never make show up on pages. I am assuming that its just watching and not building? What am I missing?
EDIT
I added this
gulp.watch('ui.id.go.com/public/**/*.js', ['scripts','browserify']);
but now its checking it way too often and even though updating, my machine cpu is hiked up!! any better ideas out there?
thanks