mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
perf: prevent duplicate showReady
This commit is contained in:
parent
a5373f2464
commit
89d5f3753e
@ -129,7 +129,7 @@ function startDev(oldInstance) {
|
||||
// Pass new nuxt to watch chain
|
||||
.then(() => instance)
|
||||
// Call showReady
|
||||
.then(() => nuxt.showReady(true))
|
||||
.then(() => nuxt.showReady())
|
||||
// Handle errors
|
||||
.catch(err => onError(err, instance))
|
||||
)
|
||||
|
@ -81,5 +81,5 @@ if (nuxt.options.render.ssr === true) {
|
||||
const { port, host } = getLatestHost(argv)
|
||||
|
||||
nuxt.listen(port, host).then(() => {
|
||||
nuxt.showReady()
|
||||
nuxt.showReady(false)
|
||||
})
|
||||
|
@ -209,7 +209,7 @@ export default class WebpackBaseConfig {
|
||||
compiledIn: false,
|
||||
done: () => {
|
||||
if (this.options.dev) {
|
||||
this.nuxt.showReady(true)
|
||||
this.nuxt.showReady()
|
||||
}
|
||||
}
|
||||
}))
|
||||
|
@ -21,7 +21,7 @@ export default class Nuxt {
|
||||
constructor(options = {}) {
|
||||
this.options = Options.from(options)
|
||||
|
||||
this.readyMessage = 'Ready'
|
||||
this.readyMessage = null
|
||||
this.initialized = false
|
||||
|
||||
// Hooks
|
||||
@ -106,7 +106,11 @@ export default class Nuxt {
|
||||
})
|
||||
}
|
||||
|
||||
showReady(clear = false) {
|
||||
showReady(clear = true) {
|
||||
if (!this.readyMessage) {
|
||||
return
|
||||
}
|
||||
|
||||
logger.ready({
|
||||
message: this.readyMessage,
|
||||
badge: true,
|
||||
|
Loading…
Reference in New Issue
Block a user