File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -283,8 +283,12 @@ export default async function build(
283
283
284
284
const publicDir = path . join ( dir , 'public' )
285
285
const isAppDirEnabled = ! ! config . experimental . appDir
286
+ const { pagesDir, appDir } = findPagesDir ( dir , isAppDirEnabled )
287
+ NextBuildContext . pagesDir = pagesDir
288
+ NextBuildContext . appDir = appDir
289
+ hasAppDir = Boolean ( appDir )
286
290
287
- if ( isAppDirEnabled ) {
291
+ if ( isAppDirEnabled && hasAppDir ) {
288
292
if ( ! process . env . __NEXT_TEST_MODE && ciEnvironment . hasNextSupport ) {
289
293
const requireHook = require . resolve ( '../server/require-hook' )
290
294
const contents = await promises . readFile ( requireHook , 'utf8' )
@@ -297,11 +301,6 @@ export default async function build(
297
301
}
298
302
}
299
303
300
- const { pagesDir, appDir } = findPagesDir ( dir , isAppDirEnabled )
301
- NextBuildContext . pagesDir = pagesDir
302
- NextBuildContext . appDir = appDir
303
- hasAppDir = Boolean ( appDir )
304
-
305
304
const isSrcDir = path
306
305
. relative ( dir , pagesDir || appDir || '' )
307
306
. startsWith ( 'src' )
You can’t perform that action at this time.
0 commit comments