diff options
author | 2021-10-20 04:18:29 -0700 | |
---|---|---|
committer | 2021-10-20 04:18:29 -0700 | |
commit | 58b196c58310a1489b554d16ec2695c7974eaab3 (patch) | |
tree | e631543d9b9891e01bd35e5374e987ef600a524d /packages/bun-framework-next/renderDocument.tsx | |
parent | 3dc53c3d1327f9e86467d6509cb94faacfd26580 (diff) | |
download | bun-58b196c58310a1489b554d16ec2695c7974eaab3.tar.gz bun-58b196c58310a1489b554d16ec2695c7974eaab3.tar.zst bun-58b196c58310a1489b554d16ec2695c7974eaab3.zip |
rewrote most of the router
Diffstat (limited to 'packages/bun-framework-next/renderDocument.tsx')
-rw-r--r-- | packages/bun-framework-next/renderDocument.tsx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/bun-framework-next/renderDocument.tsx b/packages/bun-framework-next/renderDocument.tsx index dfe80c3f7..aa6c85fbf 100644 --- a/packages/bun-framework-next/renderDocument.tsx +++ b/packages/bun-framework-next/renderDocument.tsx @@ -373,6 +373,7 @@ export async function render({ DocumentNamespace = null, buildId, routePaths = [], + routeNames = [], }: { buildId: number; route: any; @@ -382,6 +383,7 @@ export async function render({ appStylesheets: string[]; pageStylesheets: string[]; routePaths: string[]; + routeNames: string[]; request: Request; }): Promise<Response> { const { default: Component, getStaticProps = null } = PageNamespace || {}; @@ -393,12 +395,10 @@ export async function render({ var asPath = route.pathname; const pages = {}; - for (let path of routePaths) { - const filePath = path.substring( - path.indexOf("_next/pages/") + "_next/pages".length - ); - const name = filePath.substring(0, filePath.indexOf(".")); - pages[name] = [Bun.origin + path]; + for (let i = 0; i < routeNames.length; i++) { + const filePath = routePaths[i]; + const name = routeNames[i]; + pages[name] = [Bun.origin + filePath]; } if (appStylesheets.length > 0) { |