fix(vite): unset build.watch options for production build (#5958)

This commit is contained in:
pooya parsa 2022-07-17 17:10:27 +02:00 committed by GitHub
parent 8b6bb92d9f
commit 0839e93333
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -73,9 +73,6 @@ export async function buildServer (ctx: ViteBuildContext) {
rollupWarn(warning)
}
}
},
watch: {
exclude: ctx.nuxt.options.ignore
}
},
server: {

View File

@ -63,6 +63,9 @@ export async function bundle (nuxt: Nuxt) {
rollupOptions: {
output: { sanitizeFileName: sanitizeFilePath },
input: resolve(nuxt.options.appDir, 'entry')
},
watch: {
exclude: nuxt.options.ignore
}
},
plugins: [
@ -101,6 +104,7 @@ export async function bundle (nuxt: Nuxt) {
if (!nuxt.options.dev) {
ctx.config.server.hmr = false
ctx.config.server.watch = undefined
ctx.config.build.watch = undefined
}
await nuxt.callHook('vite:extend', ctx)