mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
Exit with code 1 on build error
This commit is contained in:
parent
55f907877e
commit
e016b5d184
@ -27,5 +27,5 @@ nuxt.generate()
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err) // eslint-disable-line no-console
|
||||
process.exit()
|
||||
process.exit(1)
|
||||
})
|
||||
|
@ -337,6 +337,7 @@ function webpackRunClient () {
|
||||
serverCompiler.run((err, stats) => {
|
||||
if (err) return reject(err)
|
||||
console.log('[nuxt:build:client]\n', stats.toString({ chunks: false, colors: true })) // eslint-disable-line no-console
|
||||
if (stats.hasErrors()) return reject('Webpack build exited with errors')
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
@ -349,6 +350,7 @@ function webpackRunServer () {
|
||||
serverCompiler.run((err, stats) => {
|
||||
if (err) return reject(err)
|
||||
console.log('[nuxt:build:server]\n', stats.toString({ chunks: false, colors: true })) // eslint-disable-line no-console
|
||||
if (stats.hasErrors()) return reject('Webpack build exited with errors')
|
||||
const bundlePath = join(serverConfig.output.path, serverConfig.output.filename)
|
||||
readFile(bundlePath, 'utf8')
|
||||
.then((bundle) => {
|
||||
|
Loading…
Reference in New Issue
Block a user