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.js
is updated the first time, which triggers thewatch
in the infinite loop because it is the one that is always changed. But this code!lib/bundle.js
didn’t work :(– Jackson
the way
lib/bundle.js
this correct @Jackson?– BrTkCa
Yes. Just to confirm... what you say there is:
.js
in the briefcaselib
, but ignore the filebundle.js
in 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