You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: server/index.js
+31-25Lines changed: 31 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -150,36 +150,42 @@ export default class Server {
150
150
}
151
151
}
152
152
153
-
if(this.nextConfig.useFileSystemPublicRoutes){
154
-
// Makes `next export` exportPathMap work in development mode.
155
-
// So that the user doesn't have to define a custom server reading the exportPathMap
156
-
if(this.dev&&this.nextConfig.exportPathMap){
157
-
console.log('Defining routes from exportPathMap')
158
-
constexportPathMap=awaitthis.nextConfig.exportPathMap({},{dev: true,dir: this.dir,outDir: null,distDir: this.distDir,buildId: this.buildId})// In development we can't give a default path mapping
159
-
for(constpathinexportPathMap){
160
-
const{page, query ={}}=exportPathMap[path]
161
-
routes[path]=async(req,res,params,parsedUrl)=>{
162
-
const{query: urlQuery}=parsedUrl
163
-
164
-
Object.keys(urlQuery)
165
-
.filter(key=>query[key]===undefined)
166
-
.forEach(key=>console.warn(`Url defines a query parameter '${key}' that is missing in exportPathMap`))
// Makes `next export` exportPathMap work in development mode.
168
+
// So that the user doesn't have to define a custom server reading the exportPathMap
169
+
if(this.dev&&this.nextConfig.exportPathMap){
170
+
console.log('Defining routes from exportPathMap')
171
+
constexportPathMap=awaitthis.nextConfig.exportPathMap({},{dev: true,dir: this.dir,outDir: null,distDir: this.distDir,buildId: this.buildId})// In development we can't give a default path mapping
172
+
for(constpathinexportPathMap){
173
+
const{page, query ={}}=exportPathMap[path]
174
+
routes[path]=async(req,res,params,parsedUrl)=>{
175
+
const{query: urlQuery}=parsedUrl
176
+
177
+
Object.keys(urlQuery)
178
+
.filter(key=>query[key]===undefined)
179
+
.forEach(key=>console.warn(`Url defines a query parameter '${key}' that is missing in exportPathMap`))
0 commit comments