fix: throw error when building failed in quiet mode (#6075)

This commit is contained in:
Xin Du (Clark) 2019-07-17 20:04:40 +01:00 committed by GitHub
parent 1f10f40a1f
commit 26a62596c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -146,12 +146,12 @@ export class WebpackBundler {
const stats = await compiler.run()
if (stats.hasErrors()) {
// non-quiet mode: errors will be printed by webpack itself
const error = new Error('Nuxt build error')
if (options.build.quiet === true) {
return Promise.reject(stats.toString(options.build.stats))
error.stack = stats.toString('errors-only')
}
// Actual error will be printed by webpack
throw new Error('Nuxt Build Error')
throw error
}
// Await for renderer to load resources (programmatic, tests and generate)