mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-21 21:25:11 +00:00
fix(nuxt): close top-level watcher on nuxt 'close' (#27571)
This commit is contained in:
parent
803100e34e
commit
6bca120d02
@ -136,6 +136,7 @@ function createGranularWatcher () {
|
||||
console.timeEnd('[nuxt] builder:chokidar:watch')
|
||||
}
|
||||
})
|
||||
nuxt.hook('close', () => watcher?.close())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,10 @@ export function createNuxt (options: NuxtOptions): Nuxt {
|
||||
addHooks: hooks.addHooks,
|
||||
hook: hooks.hook,
|
||||
ready: () => initNuxt(nuxt),
|
||||
close: () => Promise.resolve(hooks.callHook('close', nuxt)),
|
||||
close: async () => {
|
||||
await hooks.callHook('close', nuxt)
|
||||
hooks.removeAllHooks()
|
||||
},
|
||||
vfs: {},
|
||||
apps: {},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user