Skip to content
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

browserSync.reload() not actually reloading browser #113

Open
jbeckton opened this issue May 9, 2016 · 1 comment
Open

browserSync.reload() not actually reloading browser #113

jbeckton opened this issue May 9, 2016 · 1 comment

Comments

@jbeckton
Copy link

jbeckton commented May 9, 2016

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
        }

  });

});
@webuniverseio
Copy link

#88 suggests to use start instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants