mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
fix(cli): handle error in full static mode with --fail-on-error
(#7948)
This commit is contained in:
parent
51b037fea6
commit
e0af2ed679
@ -12,8 +12,11 @@ export async function generate (cmd) {
|
||||
const generator = await cmd.getGenerator(nuxt)
|
||||
|
||||
await nuxt.server.listen(0)
|
||||
await generator.generate({ build: false })
|
||||
const { errors } = await generator.generate({ build: false })
|
||||
await nuxt.close()
|
||||
if (cmd.argv['fail-on-error'] && errors.length > 0) {
|
||||
throw new Error('Error generating pages, exiting with non-zero code')
|
||||
}
|
||||
}
|
||||
|
||||
export async function ensureBuild (cmd) {
|
||||
|
Loading…
Reference in New Issue
Block a user