Вот как я у себя настраивал:
var browserSync = require('browser-sync').create();
var nodemon = require('gulp-nodemon');
gulp.task('browserSync', ['nodemon'], function() {
browserSync.init({
proxy: "http://localhost:3000",
})
})
gulp.task('nodemon', function (cb) {
var callbackCalled = false;
return nodemon({script: './app.js'}).on('start', function () {
if (!callbackCalled) {
callbackCalled = true;
cb();
}
});
});
gulp.task('watch', ['browserSync', 'sass', 'minify-css', 'minify-js'], function() {
gulp.watch('scss/*.scss', ['sass']);
gulp.watch('./public/css/*.css', ['minify-css']);
gulp.watch('./public/js/*.js', ['minify-js']);
gulp.watch('./views/*.pug', browserSync.reload);
});