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

reloadDebounce ignored when using browserSync.reload with gulp #1192

Open
2 of 10 tasks
fracz opened this issue Sep 5, 2016 · 3 comments
Open
2 of 10 tasks

reloadDebounce ignored when using browserSync.reload with gulp #1192

fracz opened this issue Sep 5, 2016 · 3 comments
Labels

Comments

@fracz
Copy link

fracz commented Sep 5, 2016

Having the following gulp configuration

var browserSync = require('browser-sync').create();
gulp.task('bs', ['watch'],  function() {
  browserSync.init({
    open: no,
    reloadOnRestart: yes,
    reloadDebounce: 10000,
    online: no
  });
  gulp.watch('dist/modules/**/*.{js,html}').on('change', browserSync.reload)
});

the browser is immediately refreshed after change. It should be refreshed after 10s of "event silence", as docs say.

  • Browsersync [ 1.14.3 ]
  • Node [ 5.1.1 ]
  • Npm [ 3.3.12 ]

Affected platforms

  • linux
  • windows
  • OS X
  • freebsd
  • solaris
  • other (please specify which)

Browsersync use-case

  • API
  • Gulp
  • Grunt
  • CLI
@shakyShane
Copy link
Contributor

@fracz thanks, I was waiting for someone to pick up on this before acting on this.

The core problem is that all logic for delay/throttle/debounce is applied to file-watching only at present. But as you've noticed, because the API method is named reload, you would expect reload* options to affect this, which they don't.

@fracz
Copy link
Author

fracz commented Sep 5, 2016

Apparently, the reloadDelay is respected when calling the browserSync.reload(). Although they are not the same, it can be used as a workaround for now.

@shakyShane
Copy link
Contributor

ok that's good, deffo needs fixing though. there needs to be some re-structuring put in place, which is unfortunately not a quick job :(

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

No branches or pull requests

2 participants