1
I’m Gulp’s new student, and I did this watch if my Java files are changed, it build-js. But when I run Gulp, it compiles all right but it keeps running the build-js an infinite loop. What I did wrong?
Thank you!
gulp.task('build-js', function (cb) {
pump([
gulp.src('lib/*.js'),
uglify(),
gulp.dest('dist')
],
cb
);
});
gulp.task('watch-js', function () {
gulp.watch('lib/*.js', ['build-js']);
})
gulp.task('default', ['build-js', 'watch-js']);
that’s right @Lucas, the problem is that the
bundle.jsis updated the first time, which triggers thewatchin the infinite loop because it is the one that is always changed. But this code!lib/bundle.jsdidn’t work :(– Jackson
the way
lib/bundle.jsthis correct @Jackson?– BrTkCa
Yes. Just to confirm... what you say there is:
.jsin the briefcaselib, but ignore the filebundle.jsin the briefcaselib? That sounds very right, but you’re not ignoring.. :(– Jackson
That’s right! We can continue on Jackson chat if you want
– BrTkCa
It makes sense that... but unfortunately it doesn’t work here =(
– Jackson