-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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: expose server resolved urls #8986
Conversation
✅ Deploy Preview for vite-docs-main ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one nitpick but other than that LGTM
Thanks for the refactor 👍
Pushed a commit to reset |
Description
Implements #8891
Expose
devServer.resolvedUrls
andpreviewServer.resolvedUrls
.This PR also removes a breaking change in Vite 3 where
printUrls
are async, now they are back as sync.Additional context
This mostly refactors on how we resolve urls and print them.
Previously,
printUrls
handle the entire resolve and print flow. Now, we break it into two parts. Whenever the server starts/restarts, we resolveresolvedUrls
. This usually happens in thelisten()
function which is async and we lend to avoidprintUrls
becoming async. Then,printUrls
become a basic function that only readsresolvedUrls
and prints it.Not sure how to add tests to this, but works locally for me and for vite-plugin-qrcode.
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).