mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-19 23:21:09 +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
|
reactivityTransform: nuxt.options.experimental.reactivityTransform
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
watch: {
|
watch: { ignored: isIgnored },
|
||||||
ignored: isIgnored
|
|
||||||
},
|
|
||||||
hmr: {
|
hmr: {
|
||||||
// https://github.com/nuxt/framework/issues/4191
|
// https://github.com/nuxt/framework/issues/4191
|
||||||
protocol: 'ws',
|
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)
|
await nuxt.callHook('vite:extend', ctx)
|
||||||
|
|
||||||
nuxt.hook('vite:serverCreated', (server: vite.ViteDevServer, env) => {
|
nuxt.hook('vite:serverCreated', (server: vite.ViteDevServer, env) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user