From 8283edabfcf849bdfc3ef98208c181d12cdccdc3 Mon Sep 17 00:00:00 2001 From: yoho Date: Wed, 4 May 2022 23:48:42 +0800 Subject: [PATCH 1/2] fix: client full reload --- packages/vite/src/client/client.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/vite/src/client/client.ts b/packages/vite/src/client/client.ts index 420d084ef9a981..5f15e0a401d282 100644 --- a/packages/vite/src/client/client.ts +++ b/packages/vite/src/client/client.ts @@ -106,6 +106,7 @@ async function handleMessage(payload: HMRPayload) { const payloadPath = base + payload.path.slice(1) if ( pagePath === payloadPath || + payloadPath === '/index.html' || (pagePath.endsWith('/') && pagePath + 'index.html' === payloadPath) ) { location.reload() From f5aec2fe6c9bcc49441848eb830434c050303d37 Mon Sep 17 00:00:00 2001 From: yoho <907415276@qq.com> Date: Thu, 5 May 2022 11:29:27 +0800 Subject: [PATCH 2/2] fix: payload path Co-authored-by: patak --- packages/vite/src/client/client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite/src/client/client.ts b/packages/vite/src/client/client.ts index 5f15e0a401d282..eef44c0b7c782a 100644 --- a/packages/vite/src/client/client.ts +++ b/packages/vite/src/client/client.ts @@ -106,7 +106,7 @@ async function handleMessage(payload: HMRPayload) { const payloadPath = base + payload.path.slice(1) if ( pagePath === payloadPath || - payloadPath === '/index.html' || + payload.path === '/index.html' || (pagePath.endsWith('/') && pagePath + 'index.html' === payloadPath) ) { location.reload()