fix: prevent showReady when has compile errors

This commit is contained in:
Pooya Parsa 2018-04-02 00:00:39 +04:30
parent d6d5ae26af
commit 46fcf47db1
2 changed files with 6 additions and 4 deletions

View File

@ -128,8 +128,6 @@ function startDev(oldInstance) {
.then(() => nuxt.listen(port, host))
// Pass new nuxt to watch chain
.then(() => instance)
// Call showReady
.then(() => nuxt.showReady())
// Handle errors
.catch(err => onError(err, instance))
)

View File

@ -207,9 +207,13 @@ export default class WebpackBaseConfig {
name: this.isServer ? 'server' : 'client',
color: this.isServer ? 'orange' : 'green',
compiledIn: false,
done: () => {
done: (states) => {
if (this.options.dev) {
this.nuxt.showReady()
const hasErrors = Object.values(states).some(state => state.stats.hasErrors())
if (!hasErrors) {
this.nuxt.showReady()
}
}
}
}))