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)
|
return reject(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
const jsonStats = stats.toJson({ warnings: true, errors: true })
|
let buildFailed = false
|
||||||
|
for (const stat of stats.stats) {
|
||||||
if (jsonStats.errors.length > 0) {
|
for (const error of stat.compilation.errors) {
|
||||||
console.log()
|
buildFailed = true
|
||||||
console.log(...jsonStats.warnings)
|
console.error('ERROR', error)
|
||||||
console.error(...jsonStats.errors)
|
console.error('ORIGINAL ERROR', error.error)
|
||||||
return reject(new Error('Soft webpack errors'))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (jsonStats.warnings.length > 0) {
|
for (const warning of stat.compilation.warnings) {
|
||||||
console.log()
|
buildFailed = true
|
||||||
console.log(...jsonStats.warnings)
|
console.warn('WARNING', warning)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (buildFailed) {
|
||||||
|
return reject(new Error('Webpack errors'))
|
||||||
}
|
}
|
||||||
|
|
||||||
resolve()
|
resolve()
|
||||||
|
|
Loading…
Reference in a new issue