Skip to content

Commit

Permalink
fix: resolve page hash case-insenstively, close vuejs#202
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jan 8, 2021
1 parent d8bf3b2 commit 049f61e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/client/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function shouldHotReload(payload: any): boolean {
if (inBrowser) {
const { app, router } = createApp()

// wait unitl page component is fetched before mounting
// wait util page component is fetched before mounting
router.go().then(() => {
app.mount('#app')
})
Expand Down
2 changes: 1 addition & 1 deletion src/client/app/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const getDefaultRoute = (): Route => ({
path: '/',
component: null,
// this will be set upon initial page load, which is before
// the app is mounted, so it's guaranteed to be avaiable in
// the app is mounted, so it's guaranteed to be available in
// components
data: null as any
})
Expand Down
2 changes: 1 addition & 1 deletion src/node/build/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export async function renderPage(
const pageServerJsFileName = pageName + '.js'
// for any initial page load, we only need the lean version of the page js
// since the static content is already on the page!
const pageHash = pageToHashMap[pageName]
const pageHash = pageToHashMap[pageName.toLowerCase()]
const pageClientJsFileName = `assets/${pageName}.${pageHash}.lean.js`

// resolve page data so we can render head tags
Expand Down
2 changes: 1 addition & 1 deletion src/node/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export function createVitePressPlugin(
if (isPageChunk(chunk)) {
// record page -> hash relations
const hash = chunk.fileName.match(hashRE)![1]
pageToHashMap![chunk.name] = hash
pageToHashMap![chunk.name.toLowerCase()] = hash

// inject another chunk with the content stripped
bundle[name + '-lean'] = {
Expand Down

0 comments on commit 049f61e

Please sign in to comment.