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
79fb13e5
Unverified
Commit
79fb13e5
authored
Feb 11, 2020
by
Joe Haddad
Committed by
GitHub
Feb 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Builds with Warnings Still Complete (#10498)
parent
189fc985
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
5 deletions
+36
-5
index.ts
packages/next/build/index.ts
+8
-5
warning.skip
test/integration/telemetry/pages/warning.skip
+8
-0
index.test.js
test/integration/telemetry/test/index.test.js
+20
-0
No files found.
packages/next/build/index.ts
View file @
79fb13e5
...
@@ -388,17 +388,20 @@ export default async function build(dir: string, conf = null): Promise<void> {
...
@@ -388,17 +388,20 @@ export default async function build(dir: string, conf = null): Promise<void> {
)
)
}
}
throw
new
Error
(
'> Build failed because of webpack errors'
)
throw
new
Error
(
'> Build failed because of webpack errors'
)
}
else
if
(
result
.
warnings
.
length
>
0
)
{
console
.
warn
(
chalk
.
yellow
(
'Compiled with warnings.
\
n'
))
console
.
warn
(
result
.
warnings
.
join
(
'
\
n
\
n'
))
console
.
warn
()
}
else
{
}
else
{
console
.
log
(
chalk
.
green
(
'Compiled successfully.
\
n'
))
telemetry
.
record
(
telemetry
.
record
(
eventBuildCompleted
(
pagePaths
,
{
eventBuildCompleted
(
pagePaths
,
{
durationInSeconds
:
webpackBuildEnd
[
0
],
durationInSeconds
:
webpackBuildEnd
[
0
],
})
})
)
)
if
(
result
.
warnings
.
length
>
0
)
{
console
.
warn
(
chalk
.
yellow
(
'Compiled with warnings.
\
n'
))
console
.
warn
(
result
.
warnings
.
join
(
'
\
n
\
n'
))
console
.
warn
()
}
else
{
console
.
log
(
chalk
.
green
(
'Compiled successfully.
\
n'
))
}
}
}
const
postBuildSpinner
=
createSpinner
({
const
postBuildSpinner
=
createSpinner
({
prefixText
:
'Automatically optimizing pages'
,
prefixText
:
'Automatically optimizing pages'
,
...
...
test/integration/telemetry/pages/warning.skip
0 → 100644
View file @
79fb13e5
function a(v) {
return v
}
;['index.js'].forEach(f => {
require(a('./' + f))
})
export default () => 'Warn'
test/integration/telemetry/test/index.test.js
View file @
79fb13e5
...
@@ -93,6 +93,26 @@ describe('Telemetry CLI', () => {
...
@@ -93,6 +93,26 @@ describe('Telemetry CLI', () => {
expect
(
stderr2
).
toMatch
(
/isSrcDir.*
?
true/
)
expect
(
stderr2
).
toMatch
(
/isSrcDir.*
?
true/
)
})
})
it
(
'logs completed `next build` with warnings'
,
async
()
=>
{
await
fs
.
rename
(
path
.
join
(
appDir
,
'pages'
,
'warning.skip'
),
path
.
join
(
appDir
,
'pages'
,
'warning.js'
)
)
const
{
stderr
}
=
await
runNextCommand
([
'build'
,
appDir
],
{
stderr
:
true
,
env
:
{
NEXT_TELEMETRY_DEBUG
:
1
,
},
})
await
fs
.
rename
(
path
.
join
(
appDir
,
'pages'
,
'warning.js'
),
path
.
join
(
appDir
,
'pages'
,
'warning.skip'
)
)
expect
(
stderr
).
toMatch
(
/Compiled with warnings/
)
expect
(
stderr
).
toMatch
(
/NEXT_BUILD_COMPLETED/
)
})
it
(
'detects tests correctly for `next build`'
,
async
()
=>
{
it
(
'detects tests correctly for `next build`'
,
async
()
=>
{
await
fs
.
rename
(
await
fs
.
rename
(
path
.
join
(
appDir
,
'pages'
,
'hello.test.skip'
),
path
.
join
(
appDir
,
'pages'
,
'hello.test.skip'
),
...
...
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