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
11 changes: 8 additions & 3 deletions packages/vite/src/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ export async function bundle (nuxt: Nuxt) {
reactivityTransform: nuxt.options.experimental.reactivityTransform
},
server: {
watch: {
ignored: isIgnored
},
watch: { ignored: isIgnored },
hmr: {
// https://github.com/nuxt/framework/issues/4191
protocol: 'ws',
Expand All @@ -96,6 +94,13 @@ export async function bundle (nuxt: Nuxt) {
)
}

// In build mode we explicitly override any vite options that vite is relying on
// to detect whether to inject production or development code (such as HMR code)
if (!nuxt.options.dev) {
ctx.config.server.hmr = false
ctx.config.server.watch = undefined
}

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

nuxt.hook('vite:serverCreated', (server: vite.ViteDevServer, env) => {
Expand Down