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

fix: print urls when dns order change #12261

Merged
merged 4 commits into from
Mar 11, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 5 additions & 31 deletions packages/vite/src/node/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -819,37 +819,11 @@ export function diffDnsOrderChange(
oldUrls: ViteDevServer['resolvedUrls'],
newUrls: ViteDevServer['resolvedUrls'],
): boolean {
if (oldUrls && newUrls) {
const { local: oldLocal, network: oldNetwork } = oldUrls
const { local: newLocal, network: newNetwork } = newUrls
const localChange = oldLocal.length !== newLocal.length
const networkChange = oldNetwork.length !== newNetwork.length
if (!localChange) {
for (let i = 0; i < oldLocal.length; i++) {
if (oldLocal[i] !== newLocal[i]) {
return true
}
}
}
if (!networkChange) {
for (let i = 0; i < oldNetwork.length; i++) {
if (oldNetwork[i] !== newNetwork[i]) {
return true
}
}
}
return localChange || networkChange
}
if (!oldUrls && !newUrls) {
return false
}
if (oldUrls && !newUrls) {
return true
}
if (!oldUrls && newUrls) {
return true
}
return false
return !(
oldUrls === newUrls ||
(arrayEqual(oldUrls?.local || [], newUrls?.local || []) &&
arrayEqual(oldUrls?.network || [], newUrls?.network || []))
)
patak-dev marked this conversation as resolved.
Show resolved Hide resolved
}

export interface Hostname {
Expand Down