Skip to content

Commit

Permalink
Fix pageUrl having double slash on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Feb 5, 2020
1 parent d566f00 commit a7a6787
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/next/server/on-demand-entry-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,12 @@ export default function onDemandEntryHandler(
throw pageNotFoundError(normalizedPagePath)
}

let pageUrl = `${pagePath[0] !== '/' ? '/' : ''}${pagePath
let pageUrl = pagePath.replace(/\\/g, '/')

pageUrl = `${pageUrl[0] !== '/' ? '/' : ''}${pageUrl
.replace(new RegExp(`\\.+(?:${pageExtensions.join('|')})$`), '')
.replace(/\\/g, '/')}`.replace(/\/index$/, '')
.replace(/\/index$/, '')}`

pageUrl = pageUrl === '' ? '/' : pageUrl

const bundleFile = `${normalizePagePath(pageUrl)}.js`
Expand Down

0 comments on commit a7a6787

Please sign in to comment.