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

how to open a web page automatically #749

Open
maclanelf opened this issue Nov 30, 2022 · 1 comment
Open

how to open a web page automatically #749

maclanelf opened this issue Nov 30, 2022 · 1 comment

Comments

@maclanelf
Copy link

maclanelf commented Nov 30, 2022

Description

how to open a web page automatically after started,i didn't see in serve --help,,,,is it not supported?

Why

how to open a web page automatically after started,i didn't see in serve --help,,,,is it not supported?

Alternatives

how to open a web page automatically after started,i didn't see in serve --help,,,,is it not supported?

@mazimcoder
Copy link

mazimcoder commented Sep 3, 2023

@maclanelf here's a solution for this issue:

Serve is not designed for this purpose, you can open chrome with the designated port of the serve as below script where the port is 3000 will be served by serve tool and opened by the chrome browser. Add the script in packages.json for either Mac or Windows:

Mac

"serve":"open -n -a /Applications/Google\\ Chrome.app -u http://localhost:3000 && serve build/ -l 3000"

Windows

"serve":"\"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe\" -u http://localhost:3000 && serve build/ -l 3000"

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