Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
refactor: move to warmupEntry
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Aug 15, 2022
1 parent 5a073aa commit 882b687
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 0 additions & 5 deletions packages/schema/src/config/experimental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ export default {
}
},

/**
* Warmup vite entrypoint caches on dev startup.
*/
viteEntryWarmup: true,

/**
* Split server bundle into multiple chunks and dynamically import them.
*
Expand Down
6 changes: 5 additions & 1 deletion packages/schema/src/types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion packages/vite/src/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export async function bundle (nuxt: Nuxt) {
}
})

if (nuxt.options.experimental.viteEntryWarmup) {
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`))
Expand Down

0 comments on commit 882b687

Please sign in to comment.