I updated Gulp to version 4.0.0 and encountered the following problem. There is gulpfile.js, and when you start the task, watch browsersync constantly processes the js files without editing the code in the files, and the console reports every second that the js files have been changed and the page is constantly updated. But this problem is observed only when the task 'js' is located in the task of Watch in the gulp.parallel () function, when it is deleted everything works fine. The order of tasks is the same as in my file. Thank.

gulp.task('js', function() { return gulp.src([ 'app/js/jquery-3.3.1.min.js', 'app/js/main.js' // always in the end ]) .pipe(concat('scripts.min.js')) .pipe(uglify()) .pipe(gulp.dest('app/js')) .pipe(browserSync.reload({stream: true})); }); gulp.task('sass', function() { return gulp.src('app/sass/**/*.sass') .pipe(sass({outputStyle: 'expand'}).on("error", notify.onError())) .pipe(rename({suffix: '.min', prefix : ''})) .pipe(autoprefixer(['last 15 versions'])) .pipe(cleanCSS()) .pipe(gulp.dest('app/css')) .pipe(browserSync.reload({stream: true})); }); gulp.task('watch', function(cb) { gulp.parallel( 'sass', 'js', 'browser-sync' )(cb); gulp.watch('app/sass/**/*.sass', gulp.series('sass')); gulp.watch(['app/js/**/*.js', 'app/js/main.js'], gulp.series('js')); gulp.watch('app/*.html', browserSync.reload); }); 
  • Faced the same problem. You can find out, could you solve it or not? Very interesting. Since your post is the only one with such a problem. - Georgii Filipov
  • @GeorgiiFilipov github.com/unsxxndxrk/Gulp-Starter-Pack - undefined
  • Watch is looking where the files are compiled, no? - Nikolay Sergeevich

0