Skip to content

Commit

Permalink
Disable Vite optimizer for sync and config loading (#6902)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored Apr 25, 2023
1 parent b246070 commit 0afff32
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/shiny-roses-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Disable Vite optimizer for sync and config loading. Improve first page load time for warm server startup.
2 changes: 1 addition & 1 deletion packages/astro/src/core/config/vite-load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/core/sync/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export async function sync(
await createVite(
{
server: { middlewareMode: true, hmr: false },
optimizeDeps: { entries: [] },
optimizeDeps: { disabled: true },
ssr: { external: [] },
logLevel: 'silent',
},
Expand Down

0 comments on commit 0afff32

Please sign in to comment.