Skip to content

Commit

Permalink
Serialize JSON Warnings Before Event (#11976)
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer authored Apr 17, 2020
1 parent 511cf74 commit 48e2c19
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/next/build/output/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,15 @@ export function watchCompilers(

stats.compilation.errors.push(...(filteredErrors || []))
stats.compilation.warnings.push(...(filteredWarnings || []))
const {
errors: newErrors,
warnings: newWarnings,
} = formatWebpackMessages(
stats.toJson({ all: false, warnings: true, errors: true })
)
onTypeChecked({
errors: stats.compilation.errors.length
? stats.compilation.errors
: null,
warnings: stats.compilation.warnings.length
? stats.compilation.warnings
: null,
errors: newErrors?.length ? newErrors : null,
warnings: newWarnings?.length ? newWarnings : null,
})

onEvent({
Expand Down

0 comments on commit 48e2c19

Please sign in to comment.