Skip to content

Commit

Permalink
Fix basePath handling (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
baked-dev authored May 3, 2023
1 parent 7ad68bf commit 811525c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/runtime/src/router/ejected/body/branches/next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const renderNext = ({ internalPath, externalPath }: EjectedNextResponse) =>
(isDynamic(internalPath)
? `
next = (final_params) =>
\`${internalPath
\`\${nextRequest.nextUrl.basePath || ""}${internalPath
.replace(/\/(:[^/]*)/gm, (match, value) => {
return match.replace(value, `\${final_params.${value.slice(1)}}`);
})
Expand All @@ -20,7 +20,7 @@ next = (final_params) =>
`
: internalPath !== "//" && internalPath !== externalPath
? `
next = "${internalPath}";
next = \`\${nextRequest.nextUrl.basePath || ""}${internalPath}\`;
`
: `
next = true;
Expand Down

0 comments on commit 811525c

Please sign in to comment.