Auto-opening the browser tab can get really annoying in certain situations.
Sometimes I already have the window open and would prefer to just reload the tab.
Other times I'm testing another browser and don't want to keep opening my default browser.
Sometimes I need to open a custom URL. In my latest project, I need to add a query string to use the staging server instead of the production server. With the suppression flag, I could change my start script to: react-scripts start --no-open-browser; open localhost:3000?useapi=production
You can run BROWSER=none npm start
or create an .env
file with BROWSER=none
in it to prevent the browser from opening.
Let us know if you need help with anything else!
What exactly does the script do? I haven't had time to even look at it tbh.
On Thu, May 4, 2017 at 9:36 PM, Joe Haddad notifications@github.com wrote:
You can run BROWSER=none npm start or create an .env file with
BROWSER=none in it to prevent the browser from opening.Let us know if you need help with anything else!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/facebookincubator/create-react-app/issues/2084#issuecomment-299357398,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AXnF2CDsfqBcnqiyrdJgQpHoc1aihRxQks5r2osdgaJpZM4NQ-AK
.
Thank you @Timer! That's exactly what I needed.
Was that documented somewhere? I tried to look around first but I could have missed it.
Yea, it’s tucked away here:
https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#advanced-configuration
Sometimes I already have the window open and would prefer to just reload the tab.
This is exactly what it should do on OS X. Unfortunately it’s not possible on other systems 😞
Somehow it doesn't do that for me, and I have the latest OS X. Maybe because I'm using Firefox?
Yeah, our tab reloading only works for Chrome (sorry!).
If you're familiar with AppleScript, you can try to contribute Firefox support!
Most helpful comment
You can run
BROWSER=none npm start
or create an.env
file withBROWSER=none
in it to prevent the browser from opening.Let us know if you need help with anything else!