Skip to content

Commit

Permalink
fix(build): handle cleanUrls without trailing slash (#1772)
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd authored Jan 7, 2023
1 parent 0913e0f commit 2a80fbd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/client/app/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ export function pathToFile(path: string): string {
// client production build needs to account for page hash, which is
// injected directly in the page's html
let pageHash = __VP_HASH_MAP__[pagePath.toLowerCase()]
if (!pageHash && pagePath.endsWith('_index.md')) {
pagePath = pagePath.slice(0, -9) + '.md'
if (!pageHash) {
pagePath = pagePath.endsWith('_index.md')
? pagePath.slice(0, -9) + '.md'
: pagePath.slice(0, -3) + '_index.md'
pageHash = __VP_HASH_MAP__[pagePath.toLowerCase()]
}
pagePath = `${base}assets/${pagePath}.${pageHash}.js`
Expand Down

0 comments on commit 2a80fbd

Please sign in to comment.