Skip to content

Commit

Permalink
chore: no-case-declarations (vitejs#2730)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 committed Mar 27, 2021
1 parent 66cec9d commit 2358dfc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/vite/src/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,13 @@ async function handleMessage(payload: HMRPayload) {
}
})
break
case 'custom':
case 'custom': {
const cbs = customListenersMap.get(payload.event)
if (cbs) {
cbs.forEach((cb) => cb(payload.data))
}
break
}
case 'full-reload':
if (payload.path && payload.path.endsWith('.html')) {
// if html file is edited, only reload the page if the browser is
Expand Down Expand Up @@ -116,17 +117,19 @@ async function handleMessage(payload: HMRPayload) {
}
})
break
case 'error':
case 'error': {
const err = payload.err
if (enableOverlay) {
createErrorOverlay(err)
} else {
console.error(`[vite] Internal Server Error\n${err.stack}`)
}
break
default:
}
default: {
const check: never = payload
return check
}
}
}

Expand Down

0 comments on commit 2358dfc

Please sign in to comment.