[build-utils] Add support for writing routes-manifest.json#7062
Conversation
Codecov Report
@@ Coverage Diff @@
## main #7062 +/- ##
=======================================
Coverage 51.49% 51.49%
=======================================
Files 128 128
Lines 4979 4979
Branches 1172 1172
=======================================
Hits 2564 2564
Misses 2407 2407
Partials 8 8 Continue to review full report at Codecov.
|
| ], | ||
| dynamicRoutes: [ | ||
| { | ||
| page: '/api/project/[aid]/[bid]/index', |
There was a problem hiding this comment.
@AndyBitz Does the page need to strip /index here?
There was a problem hiding this comment.
Good question. I think it doesn't matter, because /index and / should be equal
There was a problem hiding this comment.
Ah, I think it'd be best to remove it, as I just checked what Next.js does:
"dynamicRoutes": [
{
"page": "/[nice]",
"regex": "^/([^/]+?)(?:/)?$",
"routeKeys": {
"nice": "nice"
},
"namedRegex": "^/(?<nice>[^/]+?)(?:/)?$"
}
]
for a pages/[nice]/index.js
There was a problem hiding this comment.
Not relevant because Next.js will not create an index file for it, it'll make [nice] the file itself, so yea, we can leave it as it is.
| pages404: true, | ||
| redirects: [], | ||
| rewrites: [ | ||
| /* TODO: `handle: miss` |
There was a problem hiding this comment.
Currently, zero config routes have a handle: miss phase thats used to add a rewrite so that both the extension and the extensionless api file work (unless cleanUrls: true which will use a redirect instead).
However, the current routes-manifest.json doesn't support handle: miss routes, so we'll need to provide a new prop in the manifest if we want to keep the same behavior.
Uh oh!
There was an error while loading. Please reload this page.