@@ -96,6 +96,8 @@ export default class DevServer extends Server {
96
96
protected sortedRoutes ?: string [ ]
97
97
private addedUpgradeListener = false
98
98
private pagesDir : string
99
+ // @ts -ignore TODO: add implementation
100
+ private rootDir ?: string
99
101
100
102
protected staticPathsWorker ?: { [ key : string ] : any } & {
101
103
loadStaticPaths : typeof import ( './static-paths-worker' ) . loadStaticPaths
@@ -175,7 +177,13 @@ export default class DevServer extends Server {
175
177
}
176
178
177
179
this . isCustomServer = ! options . isNextDevCommand
178
- this . pagesDir = findPagesDir ( this . dir )
180
+ // TODO: hot-reload root/pages dirs?
181
+ const { pages : pagesDir , root : rootDir } = findPagesDir (
182
+ this . dir ,
183
+ this . nextConfig . experimental . rootDir
184
+ )
185
+ this . pagesDir = pagesDir
186
+ this . rootDir = rootDir
179
187
}
180
188
181
189
protected getBuildId ( ) : string {
@@ -361,7 +369,12 @@ export default class DevServer extends Server {
361
369
async prepare ( ) : Promise < void > {
362
370
setGlobal ( 'distDir' , this . distDir )
363
371
setGlobal ( 'phase' , PHASE_DEVELOPMENT_SERVER )
364
- await verifyTypeScriptSetup ( this . dir , this . pagesDir , false , this . nextConfig )
372
+ await verifyTypeScriptSetup (
373
+ this . dir ,
374
+ [ this . pagesDir ! , this . rootDir ] . filter ( Boolean ) as string [ ] ,
375
+ false ,
376
+ this . nextConfig
377
+ )
365
378
366
379
this . customRoutes = await loadCustomRoutes ( this . nextConfig )
367
380
0 commit comments