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.
|
||||
* @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) {
|
||||
}
|
||||
})
|
||||
|
||||
if (nuxt.options.vite.warmupEntry !== false) {
|
||||
const start = Date.now()
|
||||
warmupViteServer(server, [join('/@fs/', ctx.entry)])
|
||||
.then(() => logger.info(`Vite ${env.isClient ? 'client' : 'server'} warmed up in ${Date.now() - start}ms`))
|
||||
.catch(logger.error)
|
||||
}
|
||||
})
|
||||
|
||||
await buildClient(ctx)
|
||||
|
Loading…
Reference in New Issue
Block a user