diff --git a/.changeset/shiny-roses-tap.md b/.changeset/shiny-roses-tap.md new file mode 100644 index 0000000000..2f537c400b --- /dev/null +++ b/.changeset/shiny-roses-tap.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Disable Vite optimizer for sync and config loading. Improve first page load time for warm server startup. diff --git a/packages/astro/src/core/config/vite-load.ts b/packages/astro/src/core/config/vite-load.ts index 1a620ab90a..a0d4ee913e 100644 --- a/packages/astro/src/core/config/vite-load.ts +++ b/packages/astro/src/core/config/vite-load.ts @@ -11,7 +11,7 @@ export interface ViteLoader { async function createViteLoader(root: string, fs: typeof fsType): Promise { const viteServer = await vite.createServer({ server: { middlewareMode: true, hmr: false }, - optimizeDeps: { entries: [] }, + optimizeDeps: { disabled: true }, clearScreen: false, appType: 'custom', ssr: { diff --git a/packages/astro/src/core/sync/index.ts b/packages/astro/src/core/sync/index.ts index ba55a22002..0017225d05 100644 --- a/packages/astro/src/core/sync/index.ts +++ b/packages/astro/src/core/sync/index.ts @@ -66,7 +66,7 @@ export async function sync( await createVite( { server: { middlewareMode: true, hmr: false }, - optimizeDeps: { entries: [] }, + optimizeDeps: { disabled: true }, ssr: { external: [] }, logLevel: 'silent', },