mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(vite): disable hmr in build (#5505)
This commit is contained in:
parent
697f547b2c
commit
e38de4af4d
@ -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',
|
||||
@ -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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user