question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to turn off browser-sync in --release?

See original GitHub issue

I would like to add a flag or modify yarn start -- --release to start RSK without browser-sync. It is a big dependency and I would like to turn it off in production.

Can anyone point me in the right direction?

I believe the only place that Browser-Sync is referenced directly is in ./tools/start.js

  // Launch the development server with Browsersync and HMR
  await new Promise((resolve, reject) => browserSync.create().init({
    // https://www.browsersync.io/docs/options
    server: 'src/server.js',
    middleware: [server],
    open: !process.argv.includes('--silent'),
    ...isDebug ? {} : { notify: false, ui: false },
  }, (error, bs) => (error ? reject(error) : resolve(bs))));

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
frenzzycommented, Jul 10, 2017

Browsersync is not used for production. To run the production build you need:

$ yarn run build -- --release    # compile app in release mode
$ node build/server.js           # run the production server

However if you want to remove Browsersync from development server (yarn start) then you need to replace lines mentioned above with something like this:

server.listen(3000, () => {
  console.info('The development server is running at http://localhost:3000/');
});
1reaction
victorvu88commented, May 28, 2019

Add more property ghostMode: false,

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to temporarily disable browsersync? - Stack Overflow
There doesn't seem to be a configuration option to do just this, but one hacky workaround is to use snippetOptions to specify a...
Read more >
Browsersync options
Clicks, Scrolls & Form inputs on any device will be mirrored to all others. // Here you can disable/enable each feature individually ghostMode:...
Read more >
How to turn off Browsersync ghostMode in Eleventy
A quick how-to.
Read more >
How to turn off Browsersync ghostMode in Eleventy
For example, if you have the same page open in Firefox and Chrome and click a link in Firefox, both browsers will load...
Read more >
browser-sync - npm
Live CSS Reload & Browser Syncing. Latest version: 2.27.11, last published: 6 days ago. Start using browser-sync in your project by running ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found