mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
fix(nuxt-build): wait for use exit when running with --analyze flag
This commit is contained in:
parent
c4c63e0c66
commit
c3bcda873c
@ -75,12 +75,20 @@ const builder = new Builder(nuxt)
|
|||||||
// Setup hooks
|
// Setup hooks
|
||||||
nuxt.hook('error', (_err, from) => Utils.fatalError(_err, from))
|
nuxt.hook('error', (_err, from) => Utils.fatalError(_err, from))
|
||||||
|
|
||||||
|
// Close function
|
||||||
|
const close = () => {
|
||||||
|
if (options.build.analyze === true) {
|
||||||
|
return // Wait for user exit
|
||||||
|
}
|
||||||
|
process.exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
if (options.mode !== 'spa') {
|
if (options.mode !== 'spa') {
|
||||||
// -- Build for SSR app --
|
// -- Build for SSR app --
|
||||||
builder
|
builder
|
||||||
.build()
|
.build()
|
||||||
.then(() => debug('Building done'))
|
.then(() => debug('Building done'))
|
||||||
.then(() => process.exit(0))
|
.then(() => close())
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
Utils.fatalError(err)
|
Utils.fatalError(err)
|
||||||
})
|
})
|
||||||
@ -110,6 +118,6 @@ if (options.mode !== 'spa') {
|
|||||||
|
|
||||||
// Generate dist for SPA static deployment
|
// Generate dist for SPA static deployment
|
||||||
new Generator(nuxt, builder).generate({ build: true }).then(() => {
|
new Generator(nuxt, builder).generate({ build: true }).then(() => {
|
||||||
process.exit(0)
|
close()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user