diff --git a/packages/vite/src/vite.ts b/packages/vite/src/vite.ts index 29187cd857..342db7d0b1 100644 --- a/packages/vite/src/vite.ts +++ b/packages/vite/src/vite.ts @@ -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)