mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Log original error
This commit is contained in:
parent
a97c15d399
commit
d5caafb86e
|
@ -52,18 +52,22 @@ function runCompiler (compiler) {
|
|||
return reject(err)
|
||||
}
|
||||
|
||||
const jsonStats = stats.toJson({ warnings: true, errors: true })
|
||||
let buildFailed = false
|
||||
for (const stat of stats.stats) {
|
||||
for (const error of stat.compilation.errors) {
|
||||
buildFailed = true
|
||||
console.error('ERROR', error)
|
||||
console.error('ORIGINAL ERROR', error.error)
|
||||
}
|
||||
|
||||
if (jsonStats.errors.length > 0) {
|
||||
console.log()
|
||||
console.log(...jsonStats.warnings)
|
||||
console.error(...jsonStats.errors)
|
||||
return reject(new Error('Soft webpack errors'))
|
||||
for (const warning of stat.compilation.warnings) {
|
||||
buildFailed = true
|
||||
console.warn('WARNING', warning)
|
||||
}
|
||||
}
|
||||
|
||||
if (jsonStats.warnings.length > 0) {
|
||||
console.log()
|
||||
console.log(...jsonStats.warnings)
|
||||
if (buildFailed) {
|
||||
return reject(new Error('Webpack errors'))
|
||||
}
|
||||
|
||||
resolve()
|
||||
|
|
Loading…
Reference in a new issue