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

Merged
merged 3 commits into from
Feb 20, 2025

Conversation

Mrlilili
Copy link
Contributor

@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]

@sapphi-red sapphi-red added the p2-nice-to-have Not breaking anything but nice to have (priority) label Feb 14, 2025
@sapphi-red sapphi-red added this to the 6.2 milestone Feb 14, 2025
@bluwy bluwy merged commit f6926ca into vitejs:main Feb 20, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants