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

feat: use host url to open browser #19414

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Mrlilili
Copy link

@Mrlilili Mrlilili commented Feb 13, 2025

Description

When I use vite-plugin-mkcert, this issue occurs,this change will have an expression different from the previous version.

server: {
    host: 'dev.aaaa.com',
    open: true
  }

Here, the host is configured as dev.aaaa.com. In previous versions, starting vite would automatically open https://dev.aaaa.com:5137/.
In the new version, it will open https://localhost:5173/.

To maintain consistency with the previous version, need to modify server.open in vite.conf.mts to https://dev.aaaa.com:5173/.

Can it be opened using the domain name of serve.host instead of https://localhost:5173/?

Related: #19317 (comment)


It seems to be the first domain automatically opened.

const url =
server.resolvedUrls?.local[0] ?? server.resolvedUrls?.network[0]

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

Successfully merging this pull request may close these issues.

1 participant