mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
feat(vite): allow disabling entry warmup (#6647)
* feat(vite): allow opt-out from warming up entries * refactor: move to `warmupEntry`
This commit is contained in:
parent
e2745f6d75
commit
dae836a81d
@ -49,5 +49,9 @@ export interface ViteConfig extends ViteUserConfig {
|
|||||||
* Bundler for dev time server-side rendering.
|
* Bundler for dev time server-side rendering.
|
||||||
* @default 'vite-node'
|
* @default 'vite-node'
|
||||||
*/
|
*/
|
||||||
devBundler?: 'vite-node' | 'legacy'
|
devBundler?: 'vite-node' | 'legacy',
|
||||||
|
/**
|
||||||
|
* Warmup vite entrypoint caches on dev startup.
|
||||||
|
*/
|
||||||
|
warmupEntry?: boolean
|
||||||
}
|
}
|
||||||
|
@ -101,10 +101,12 @@ export async function bundle (nuxt: Nuxt) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const start = Date.now()
|
if (nuxt.options.vite.warmupEntry !== false) {
|
||||||
warmupViteServer(server, [join('/@fs/', ctx.entry)])
|
const start = Date.now()
|
||||||
.then(() => logger.info(`Vite ${env.isClient ? 'client' : 'server'} warmed up in ${Date.now() - start}ms`))
|
warmupViteServer(server, [join('/@fs/', ctx.entry)])
|
||||||
.catch(logger.error)
|
.then(() => logger.info(`Vite ${env.isClient ? 'client' : 'server'} warmed up in ${Date.now() - start}ms`))
|
||||||
|
.catch(logger.error)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
await buildClient(ctx)
|
await buildClient(ctx)
|
||||||
|
Loading…
Reference in New Issue
Block a user