You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have gulp-nodemon set up pretty much the same as the code sample and the browserSync.reload() does not reload the browser. After js or hbs file changes nodemon restarts node but browserSync is not reloading.
gulp.task('serve-server', function (callback) {
var called = false;
return nodemon({
// nodemon our expressjs server
script: 'bin/www',
env: { 'NODE_ENV': 'development' },
ext: 'js hbs',
// watch core server file(s) that require server restart on change
watch: ['/server/**/*.js', '/server/**/*.hbs'],
delay: 2000
})
.on('start', function onStart() {
// ensure start only got called once
if (!called) { callback(); }
called = true;
})
. on('restart', function onRestart() {
// reload connected browsers after a slight delay
setTimeout(function reload() {
browserSync.reload();
}, BROWSER_SYNC_RELOAD_DELAY);
});
});
gulp.task('serve-client', function() {
return browserSync.init({
port: 3005,
files: paths.clientFilesToWatch,
injectChanges: true,
logFileChanges: true,
logLevel: 'info',
notify: true,
reloadDebounce: 2000,
ghostMode: false,
proxy: {
target: 'http://localhost:3000',
ws: true
}
});
});
The text was updated successfully, but these errors were encountered:
I have gulp-nodemon set up pretty much the same as the code sample and the browserSync.reload() does not reload the browser. After js or hbs file changes nodemon restarts node but browserSync is not reloading.
The text was updated successfully, but these errors were encountered: