Skip to content

Commit

Permalink
fix: hmr when base is set (#2375)
Browse files Browse the repository at this point in the history
  • Loading branch information
zonemeen committed May 18, 2023
1 parent 0561c8f commit 484ff5d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/client/app/router.ts
Expand Up @@ -303,6 +303,8 @@ function handleHMR(route: Route): void {

function shouldHotReload(payload: PageDataPayload): boolean {
const payloadPath = payload.path.replace(/(\bindex)?\.md$/, '')
const locationPath = location.pathname.replace(/(\bindex)?\.html$/, '')
const locationPath = location.pathname
.replace(/(\bindex)?\.html$/, '')
.slice(siteDataRef.value.base.length - 1)
return payloadPath === locationPath
}

0 comments on commit 484ff5d

Please sign in to comment.