0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

Disable Vite optimizer for sync and config loading (#6902)

This commit is contained in:
Bjorn Lu 2023-04-25 20:54:41 +08:00 committed by GitHub
parent b24607069e
commit 0afff32741
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Disable Vite optimizer for sync and config loading. Improve first page load time for warm server startup.

View file

@ -11,7 +11,7 @@ export interface ViteLoader {
async function createViteLoader(root: string, fs: typeof fsType): Promise<ViteLoader> {
const viteServer = await vite.createServer({
server: { middlewareMode: true, hmr: false },
optimizeDeps: { entries: [] },
optimizeDeps: { disabled: true },
clearScreen: false,
appType: 'custom',
ssr: {

View file

@ -66,7 +66,7 @@ export async function sync(
await createVite(
{
server: { middlewareMode: true, hmr: false },
optimizeDeps: { entries: [] },
optimizeDeps: { disabled: true },
ssr: { external: [] },
logLevel: 'silent',
},