mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
perf(nuxt-dev): start first listen as fast as possible
also fixes problem with showReady not showing on first compile
This commit is contained in:
parent
c979802c4d
commit
f14ac05ce4
21
bin/nuxt-dev
21
bin/nuxt-dev
@ -109,12 +109,13 @@ function startDev(oldInstance) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
Promise.resolve()
|
Promise.resolve()
|
||||||
.then(
|
.then(() => {
|
||||||
() =>
|
if (oldInstance && oldInstance.builder) {
|
||||||
oldInstance && oldInstance.builder
|
return oldInstance.builder.unwatch()
|
||||||
? oldInstance.builder.unwatch()
|
} else {
|
||||||
: Promise.resolve()
|
return nuxt.listen(port, host)
|
||||||
)
|
}
|
||||||
|
})
|
||||||
// Start build
|
// Start build
|
||||||
.then(() => builder.build())
|
.then(() => builder.build())
|
||||||
// Close old nuxt after successful build
|
// Close old nuxt after successful build
|
||||||
@ -125,7 +126,13 @@ function startDev(oldInstance) {
|
|||||||
: Promise.resolve()
|
: Promise.resolve()
|
||||||
)
|
)
|
||||||
// Start listening
|
// Start listening
|
||||||
.then(() => nuxt.listen(port, host))
|
.then(() => {
|
||||||
|
if (oldInstance) {
|
||||||
|
return nuxt.listen(port, host)
|
||||||
|
} else {
|
||||||
|
return Promise.resolve()
|
||||||
|
}
|
||||||
|
})
|
||||||
// Pass new nuxt to watch chain
|
// Pass new nuxt to watch chain
|
||||||
.then(() => instance)
|
.then(() => instance)
|
||||||
// Handle errors
|
// Handle errors
|
||||||
|
Loading…
Reference in New Issue
Block a user