Skip to content

Commit

Permalink
fix next-app-loader on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Aug 16, 2022
1 parent 5061167 commit 905d7e9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/next/build/webpack/loaders/next-app-loader.ts
Expand Up @@ -25,7 +25,7 @@ async function createTreeCodeFromPath({
// First item in the list is the page which can't have layouts by itself
if (i === segments.length - 1) {
// Use '' for segment as it's the page. There can't be a segment called '' so this is the safest way to add it.
tree = `['', {}, {page: () => require('${pagePath}')}]`
tree = `['', {}, {page: () => require(${JSON.stringify(pagePath)})}]`
continue
}

Expand All @@ -48,12 +48,12 @@ async function createTreeCodeFromPath({
}, {
${
resolvedLayoutPath
? `layout: () => require('${resolvedLayoutPath}'),`
? `layout: () => require(${JSON.stringify(resolvedLayoutPath)}),`
: ''
}
${
resolvedLoadingPath
? `loading: () => require('${resolvedLoadingPath}'),`
? `loading: () => require(${JSON.stringify(resolvedLoadingPath)}),`
: ''
}
}]`
Expand Down

0 comments on commit 905d7e9

Please sign in to comment.