mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-30 23:32:38 +00:00
feat(builder): show compile logs with minimalCLI
This commit is contained in:
parent
d7956d5fd4
commit
c82a8907e5
@ -485,6 +485,12 @@ export default class Builder {
|
|||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
const name = compiler.options.name
|
const name = compiler.options.name
|
||||||
|
|
||||||
|
const shouldLog = this.options.minimalCLI && !this.options.test && !this.options.dev
|
||||||
|
|
||||||
|
if (shouldLog) {
|
||||||
|
this.spinner.start('Compiling ' + name + '...')
|
||||||
|
}
|
||||||
|
|
||||||
await this.nuxt.callHook('build:compile', { name, compiler })
|
await this.nuxt.callHook('build:compile', { name, compiler })
|
||||||
|
|
||||||
// Load renderer resources after build
|
// Load renderer resources after build
|
||||||
@ -523,10 +529,20 @@ export default class Builder {
|
|||||||
return reject(err)
|
return reject(err)
|
||||||
} else if (stats.hasErrors()) {
|
} else if (stats.hasErrors()) {
|
||||||
if (this.options.test) {
|
if (this.options.test) {
|
||||||
err = stats.toString({ colors: true })
|
err = stats.toString(this.options.build.stats)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shouldLog) {
|
||||||
|
this.spinner.error('Compiled ' + name + ' with some errors')
|
||||||
|
}
|
||||||
|
|
||||||
return reject(err)
|
return reject(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shouldLog) {
|
||||||
|
this.spinner.succeed('Compiled ' + name)
|
||||||
|
}
|
||||||
|
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user