Skip to content

Commit

Permalink
fix: the shortcut fails to open browser when set the host (vitejs#13579)
Browse files Browse the repository at this point in the history
  • Loading branch information
btea authored and xinxinhe1810 committed Jul 4, 2023
1 parent b6d4774 commit ba595d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vite/src/node/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,8 @@ export async function _createServer(
},
openBrowser() {
const options = server.config.server
const url = server.resolvedUrls?.local[0]
const url =
server.resolvedUrls?.local[0] ?? server.resolvedUrls?.network[0]
if (url) {
const path =
typeof options.open === 'string'
Expand Down

0 comments on commit ba595d6

Please sign in to comment.