fix(vite): close vite watcher before building (#5875)

This commit is contained in:
Daniel Roe 2022-07-13 13:44:07 +01:00 committed by GitHub
parent 0ef08190ae
commit 3ad12b5f4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,6 +101,15 @@ export async function bundle (nuxt: Nuxt) {
if (!nuxt.options.dev) {
ctx.config.server.hmr = false
ctx.config.server.watch = undefined
// TODO: Workaround for vite watching tsconfig changes
// https://github.com/nuxt/framework/pull/5875
ctx.config.plugins.push({
name: 'nuxt:close-vite-watcher',
configureServer (server) {
return server?.watcher?.close()
}
})
}
await nuxt.callHook('vite:extend', ctx)