mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-21 21:25:11 +00:00
fix(nuxt): unregister hooks the moment close
is called (#27637)
This commit is contained in:
parent
cec299bdc4
commit
fda6cf7838
@ -46,10 +46,12 @@ export async function build (nuxt: Nuxt) {
|
||||
if (!nuxt.options._prepare) {
|
||||
await Promise.all([checkForExternalConfigurationFiles(), bundle(nuxt)])
|
||||
await nuxt.callHook('build:done')
|
||||
}
|
||||
|
||||
if (!nuxt.options.dev) {
|
||||
await nuxt.callHook('close', nuxt)
|
||||
if (!nuxt.options.dev) {
|
||||
await nuxt.callHook('close', nuxt)
|
||||
}
|
||||
} else {
|
||||
nuxt.hook('prepare:types', () => nuxt.close())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,14 +49,13 @@ export function createNuxt (options: NuxtOptions): Nuxt {
|
||||
addHooks: hooks.addHooks,
|
||||
hook: hooks.hook,
|
||||
ready: () => initNuxt(nuxt),
|
||||
close: async () => {
|
||||
await hooks.callHook('close', nuxt)
|
||||
hooks.removeAllHooks()
|
||||
},
|
||||
close: () => hooks.callHook('close', nuxt),
|
||||
vfs: {},
|
||||
apps: {},
|
||||
}
|
||||
|
||||
hooks.hookOnce('close', () => { hooks.removeAllHooks() })
|
||||
|
||||
return nuxt
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user