Answer the question
In order to leave comments, you need to log in
Gulp+browswerSync task not working why?
Knowledgeable people tell me what needs to be done to make the task work? Gulp version 4.0.2
gulp.task('script', function(){
gulp.src('js/*.js')
.pipe(browserSync.reload({stream: true}))
});
Answer the question
In order to leave comments, you need to log in
It turns out that it was necessary to add return
gulp.task('script', function(){
return gulp.src('js/*.js')
.pipe(browserSync.reload({stream: true}))
});
In Gulp4, you need to signal task completion for each function.
To solve this problem, try changing your current code:
gulp.task('script', done => {
gulp.src('js/*.js')
.pipe(browserSync.reload({stream: true}))
done();
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question