mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +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')
|
console.timeEnd('[nuxt] builder:chokidar:watch')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
nuxt.hook('close', () => watcher?.close())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,10 @@ export function createNuxt (options: NuxtOptions): Nuxt {
|
|||||||
addHooks: hooks.addHooks,
|
addHooks: hooks.addHooks,
|
||||||
hook: hooks.hook,
|
hook: hooks.hook,
|
||||||
ready: () => initNuxt(nuxt),
|
ready: () => initNuxt(nuxt),
|
||||||
close: () => Promise.resolve(hooks.callHook('close', nuxt)),
|
close: async () => {
|
||||||
|
await hooks.callHook('close', nuxt)
|
||||||
|
hooks.removeAllHooks()
|
||||||
|
},
|
||||||
vfs: {},
|
vfs: {},
|
||||||
apps: {},
|
apps: {},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user