mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-13 09:33:54 +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) => {
|
.catch((err) => {
|
||||||
console.error(err) // eslint-disable-line no-console
|
console.error(err) // eslint-disable-line no-console
|
||||||
process.exit()
|
process.exit(1)
|
||||||
})
|
})
|
||||||
|
@ -337,6 +337,7 @@ function webpackRunClient () {
|
|||||||
serverCompiler.run((err, stats) => {
|
serverCompiler.run((err, stats) => {
|
||||||
if (err) return reject(err)
|
if (err) return reject(err)
|
||||||
console.log('[nuxt:build:client]\n', stats.toString({ chunks: false, colors: true })) // eslint-disable-line no-console
|
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()
|
resolve()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -349,6 +350,7 @@ function webpackRunServer () {
|
|||||||
serverCompiler.run((err, stats) => {
|
serverCompiler.run((err, stats) => {
|
||||||
if (err) return reject(err)
|
if (err) return reject(err)
|
||||||
console.log('[nuxt:build:server]\n', stats.toString({ chunks: false, colors: true })) // eslint-disable-line no-console
|
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)
|
const bundlePath = join(serverConfig.output.path, serverConfig.output.filename)
|
||||||
readFile(bundlePath, 'utf8')
|
readFile(bundlePath, 'utf8')
|
||||||
.then((bundle) => {
|
.then((bundle) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user