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
7d63592c
Commit
7d63592c
authored
Feb 22, 2026
by
devjiwonchoi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug-build-paths: log matched files with count
parent
001edfe4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
9 deletions
+24
-9
resolve-build-paths.ts
packages/next/src/lib/resolve-build-paths.ts
+8
-6
debug-build-paths.test.ts
test/production/debug-build-path/debug-build-paths.test.ts
+16
-3
No files found.
packages/next/src/lib/resolve-build-paths.ts
View file @
7d63592c
...
...
@@ -79,18 +79,20 @@ export async function resolveBuildPaths(
)
}
if
(
matches
.
length
===
0
)
{
const
matchedFiles
=
matches
.
filter
((
file
)
=>
!
fs
.
statSync
(
path
.
join
(
projectDir
,
file
)).
isDirectory
())
.
sort
()
if
(
matchedFiles
.
length
===
0
)
{
throw
new
Error
(
`Pattern "
${
patterns
.
join
(
','
)}
" did not match any files`
)
}
Log
.
info
(
`Pattern "
${
patterns
.
join
(
','
)}
" did match
${
matche
s
.
length
}
file(s)
`
`Pattern "
${
patterns
.
join
(
','
)}
" did match
${
matche
dFiles
.
length
}
file(s):\n
${
matchedFiles
.
join
(
'
\
n '
)}
`
)
for
(
const
file
of
matches
)
{
if
(
!
fs
.
statSync
(
path
.
join
(
projectDir
,
file
)).
isDirectory
())
{
categorizeAndAddPath
(
file
,
appPaths
,
pagePaths
)
}
for
(
const
file
of
matchedFiles
)
{
categorizeAndAddPath
(
file
,
appPaths
,
pagePaths
)
}
return
{
...
...
test/production/debug-build-path/debug-build-paths.test.ts
View file @
7d63592c
...
...
@@ -194,9 +194,8 @@ describe('debug-build-paths', () => {
expect
(
buildResult
.
cliOutput
).
toContain
(
'Route (app)'
)
expect
(
buildResult
.
cliOutput
).
toContain
(
'/blog/[slug]'
)
expect
(
buildResult
.
cliOutput
).
not
.
toMatch
(
/
[
○ƒ
]
\/
blog
\/\[
slug
\]\/
comments/
)
// Leading whitespace since the pattern "!app/blog/[slug]/comments/**" is in cliOutput and fails the test.
expect
(
buildResult
.
cliOutput
).
not
.
toContain
(
' /blog/[slug]/comments'
)
})
it
(
'should support multiple negation patterns'
,
async
()
=>
{
...
...
@@ -257,6 +256,20 @@ describe('debug-build-paths', () => {
expect
(
buildResult
.
cliOutput
).
not
.
toContain
(
'○ /dashboard'
)
})
it
(
'should list matched files in debug output with indentation'
,
async
()
=>
{
const
buildResult
=
await
next
.
build
({
args
:
[
'--debug-build-paths'
,
'app/**/page.tsx,!app/with-type-error/**'
,
],
})
expect
(
buildResult
.
exitCode
).
toBe
(
0
)
expect
(
buildResult
.
cliOutput
).
toMatch
(
/Pattern "app
\/\*\*\/
page
\.
tsx,!app
\/
with-type-error
\/\*\*
" did match
\d
+ file
\(
s
\)
:/
)
expect
(
buildResult
.
cliOutput
).
toContain
(
'
\
n app/page.tsx'
)
})
it
(
'should log when pattern matches files'
,
async
()
=>
{
const
buildResult
=
await
next
.
build
({
args
:
[
...
...
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