fix(nuxi): call listen hook on each restart (#4346)

This commit is contained in:
Daniel Roe 2022-04-14 09:39:27 +01:00 committed by GitHub
parent c519ceec52
commit 32c798cfc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,6 +61,7 @@ export default defineNuxtCommand({
}
currentNuxt = await loadNuxt({ rootDir, dev: true, ready: false })
await currentNuxt.ready()
await currentNuxt.hooks.callHook('listen', listener.server, listener)
await Promise.all([
writeTypes(currentNuxt).catch(console.error),
buildNuxt(currentNuxt)
@ -105,9 +106,6 @@ export default defineNuxtCommand({
})
await load(false)
if (currentNuxt) {
await currentNuxt.hooks.callHook('listen', listener.server, listener)
}
return 'wait'
}