Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
618dc2ee
Unverified
Commit
618dc2ee
authored
May 05, 2023
by
JJ Kasper
Committed by
GitHub
May 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix require-hook with just pages on deploy (#49274)
parent
25a9547c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
index.ts
packages/next/src/build/index.ts
+5
-6
No files found.
packages/next/src/build/index.ts
View file @
618dc2ee
...
@@ -283,8 +283,12 @@ export default async function build(
...
@@ -283,8 +283,12 @@ export default async function build(
const
publicDir
=
path
.
join
(
dir
,
'public'
)
const
publicDir
=
path
.
join
(
dir
,
'public'
)
const
isAppDirEnabled
=
!!
config
.
experimental
.
appDir
const
isAppDirEnabled
=
!!
config
.
experimental
.
appDir
const
{
pagesDir
,
appDir
}
=
findPagesDir
(
dir
,
isAppDirEnabled
)
NextBuildContext
.
pagesDir
=
pagesDir
NextBuildContext
.
appDir
=
appDir
hasAppDir
=
Boolean
(
appDir
)
if
(
isAppDirEnabled
)
{
if
(
isAppDirEnabled
&&
hasAppDir
)
{
if
(
!
process
.
env
.
__NEXT_TEST_MODE
&&
ciEnvironment
.
hasNextSupport
)
{
if
(
!
process
.
env
.
__NEXT_TEST_MODE
&&
ciEnvironment
.
hasNextSupport
)
{
const
requireHook
=
require
.
resolve
(
'../server/require-hook'
)
const
requireHook
=
require
.
resolve
(
'../server/require-hook'
)
const
contents
=
await
promises
.
readFile
(
requireHook
,
'utf8'
)
const
contents
=
await
promises
.
readFile
(
requireHook
,
'utf8'
)
...
@@ -297,11 +301,6 @@ export default async function build(
...
@@ -297,11 +301,6 @@ export default async function build(
}
}
}
}
const
{
pagesDir
,
appDir
}
=
findPagesDir
(
dir
,
isAppDirEnabled
)
NextBuildContext
.
pagesDir
=
pagesDir
NextBuildContext
.
appDir
=
appDir
hasAppDir
=
Boolean
(
appDir
)
const
isSrcDir
=
path
const
isSrcDir
=
path
.
relative
(
dir
,
pagesDir
||
appDir
||
''
)
.
relative
(
dir
,
pagesDir
||
appDir
||
''
)
.
startsWith
(
'src'
)
.
startsWith
(
'src'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment