fix(vite): disable server warmup with vite-node (#7512)

This commit is contained in:
pooya parsa 2022-09-14 17:59:56 +02:00 committed by GitHub
parent 326d62803b
commit 09c42fd886
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,7 +112,11 @@ export async function bundle (nuxt: Nuxt) {
} }
}) })
if (nuxt.options.vite.warmupEntry !== false) { if (
nuxt.options.vite.warmupEntry !== false &&
// https://github.com/nuxt/framework/issues/7510
!(env.isServer && ctx.nuxt.options.vite.devBundler !== 'legacy')
) {
const start = Date.now() const start = Date.now()
warmupViteServer(server, [join('/@fs/', ctx.entry)], env.isServer) warmupViteServer(server, [join('/@fs/', ctx.entry)], env.isServer)
.then(() => logger.info(`Vite ${env.isClient ? 'client' : 'server'} warmed up in ${Date.now() - start}ms`)) .then(() => logger.info(`Vite ${env.isClient ? 'client' : 'server'} warmed up in ${Date.now() - start}ms`))