File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 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(
283283
284284 const publicDir = path . join ( dir , 'public' )
285285 const isAppDirEnabled = ! ! config . experimental . appDir
286+ const { pagesDir, appDir } = findPagesDir ( dir , isAppDirEnabled )
287+ NextBuildContext . pagesDir = pagesDir
288+ NextBuildContext . appDir = appDir
289+ hasAppDir = Boolean ( appDir )
286290
287- if ( isAppDirEnabled ) {
291+ if ( isAppDirEnabled && hasAppDir ) {
288292 if ( ! process . env . __NEXT_TEST_MODE && ciEnvironment . hasNextSupport ) {
289293 const requireHook = require . resolve ( '../server/require-hook' )
290294 const contents = await promises . readFile ( requireHook , 'utf8' )
@@ -297,11 +301,6 @@ export default async function build(
297301 }
298302 }
299303
300- const { pagesDir, appDir } = findPagesDir ( dir , isAppDirEnabled )
301- NextBuildContext . pagesDir = pagesDir
302- NextBuildContext . appDir = appDir
303- hasAppDir = Boolean ( appDir )
304-
305304 const isSrcDir = path
306305 . relative ( dir , pagesDir || appDir || '' )
307306 . startsWith ( 'src' )
You can’t perform that action at this time.
0 commit comments