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

Spins up browser-sync when building #3

Open
ccoenen opened this issue Aug 18, 2015 · 3 comments
Open

Spins up browser-sync when building #3

ccoenen opened this issue Aug 18, 2015 · 3 comments

Comments

@ccoenen
Copy link

ccoenen commented Aug 18, 2015

Whenever i build for production, I see this line in my commandline:

> broccoli build out-test
[BS] Reloading Browsers...

This leads me to believe that an instance of browser-sync is spinning up even if i'm not going to use it.

@Globegitter
Copy link
Owner

Yeah the plugin is not a 100% ideal. I have written it quite quickly, so it does the job but might have a few unnecessary reloads etc. Can you show me your Brocfile though?

@ccoenen
Copy link
Author

ccoenen commented Aug 18, 2015

I'm still in heavy tinkering mode, but in the end i do this:

// 80 lines of stuff
// ...
var allTrees = [staticFiles, appJs, appCss, appNpm, appLib];
var bs = browsersync(
  allTrees,
  {
    browserSync: {
      open: false
    }
  }
);

module.exports = mergeTrees(allTrees.concat(bs));

@Globegitter
Copy link
Owner

So the plugin initialises browser-sync immediately in the constructer. This could be done of course only when it detects a change, which I did think about but just decided for the easier way. Then also it depends on the trees you put in how quickly it detects a change, etc but I think the first thing is more the issue you are describing.

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