Skip to content

Commit

Permalink
chore: remove [vite] from hmr handler
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Apr 12, 2024
1 parent a0bd463 commit 0a5614a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/vite/src/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const hmrClient = new HMRClient(
async function handleMessage(payload: HMRPayload) {
switch (payload.type) {
case 'connected':
console.debug(`[vite] connected.`)
console.debug(`connected.`)
hmrClient.messenger.flush()
// proxy(nginx, docker) hmr ws maybe caused timeout,
// so send ping package let ws keep alive.
Expand Down
10 changes: 4 additions & 6 deletions packages/vite/src/module-runner/hmrHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function handleHMRPayload(
if (!hmrClient || runner.isDestroyed()) return
switch (payload.type) {
case 'connected':
hmrClient.logger.debug(`[vite] connected.`)
hmrClient.logger.debug(`connected.`)
hmrClient.messenger.flush()
break
case 'update':
Expand All @@ -32,9 +32,7 @@ export async function handleHMRPayload(
return hmrClient.queueUpdate(update)
}

hmrClient.logger.error(
'[vite] css hmr is not supported in runner mode.',
)
hmrClient.logger.error('css hmr is not supported in runner mode.')
}),
)
await hmrClient.notifyListeners('vite:afterUpdate', payload)
Expand All @@ -54,7 +52,7 @@ export async function handleHMRPayload(

if (!clearEntrypoints.size) break

hmrClient.logger.debug(`[vite] program reload`)
hmrClient.logger.debug(`program reload`)
await hmrClient.notifyListeners('vite:beforeFullReload', payload)
runner.moduleCache.clear()

Expand All @@ -71,7 +69,7 @@ export async function handleHMRPayload(
await hmrClient.notifyListeners('vite:error', payload)
const err = payload.err
hmrClient.logger.error(
`[vite] Internal Server Error\n${err.message}\n${err.stack}`,
`Internal Server Error\n${err.message}\n${err.stack}`,
)
break
}
Expand Down

0 comments on commit 0a5614a

Please sign in to comment.