New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
G4 - Watch only running once #1626
Comments
@joe-watkins dup of #1624 |
More specifically, an exact duplicate of #1623 - please see my response at #1623 (comment) Your |
Docs for |
@phated @TrySound Thanks very much for the help! ;) Here is what I ended up doing to solve the issue w/Browsersync and Gulp 4. Removed the reload from the watch: gulp.watch(['scripts/**/*.js','!scripts/main.min.js'], buildScripts); Added function buildScripts(){
return gulp.src(appDefaults.mainJsFiles)
.pipe(concat(appDefaults.jsMin))
.pipe(uglify())
.pipe(gulp.dest(appDefaults.jsDir))
.pipe(browserSync.stream()) // <!-- this is the line added
.pipe(notify({message: 'JS Compiled'}));
} |
Wrap the browserSync.reload() in a function with a done callback :
|
Gulp watch fails after first run. this is a fix for that. Reference is as follows. gulpjs/gulp#1626 (comment)
Gulp 4 newbie here. I'm having trouble firing off a series of tasks using watch in Gulp 4. Anyone see an issue with this?
gulp.watch(['scripts/**/*.js','!scripts/main.min.js'], gulp.series(buildScripts,reload));
The darn thing only runs once.
The text was updated successfully, but these errors were encountered: