Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/vite/src/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good workaround but I expect to track this issue. watcher starting for production build is a little bit strange

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, it seems strange.

what do you think @antfu? should we raise upstream at vite?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we raise upstream at vite?

Sure if we could provide a reproduction out-side of Nuxt.

Ideally the configureServer shouldn't even be called in build, or we might accidentally have a vite dev server on build?

}
})
}

await nuxt.callHook('vite:extend', ctx)
Expand Down