Skip to content

when I change a script file, Browser Sync will reload 2 or 3 times #1067

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

Closed
lialosiu opened this issue Apr 8, 2016 · 1 comment
Closed

Comments

@lialosiu
Copy link

lialosiu commented Apr 8, 2016

I using Jade and Coffee.

when I change the script file, browser reload 2 or 3 times, it make my computer lag.

and I try to change file glup/scripts.js task scripts-reload to

gulp.task('scripts-reload', function() {
  return buildScripts()
    .pipe(browserSync.stream({once: true}));
});

added {once: true} opt.

it just reload 1 time now, but sometime file change was not sync to browser, I need to press F5 to reload 1 more time by myself.

some one has any idea?

(sorry for my pool English...)

@lotas
Copy link

lotas commented Apr 28, 2016

We had similar problem and were trying to set up timeouts, tried different options, but it didn't work.
So we end up disabling auto-reload, and doing it manually.

So we had plain watch task to listen to file modifications. In case of event we triggered scripts styles etc rebuild, and only when that finished triggered require("browser-sync").get('frontend').reload();

I think this is a problem for medium and large-sized projects, because it needs to build a lot

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