fix(webpack): print build errors (#8388)

This commit is contained in:
Daniel Roe 2022-10-24 09:44:19 +01:00 committed by GitHub
parent 7b20e13c85
commit e7e7568288
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,11 +156,8 @@ async function compile (compiler: Compiler) {
const stats = await new Promise<webpack.Stats>((resolve, reject) => compiler.run((err, stats) => err ? reject(err) : resolve(stats!)))
if (stats.hasErrors()) {
// non-quiet mode: errors will be printed by webpack itself
const error = new Error('Nuxt build error')
if (nuxt.options.build.quiet === true) {
error.stack = stats.toString('errors-only')
}
error.stack = stats.toString('errors-only')
throw error
}