diff --git a/.changeset/blue-pets-battle.md b/.changeset/blue-pets-battle.md new file mode 100644 index 000000000000..1752627435dc --- /dev/null +++ b/.changeset/blue-pets-battle.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Disables internal file watcher for one-off Vite servers to improve start-up performance diff --git a/packages/astro/src/core/config/vite-load.ts b/packages/astro/src/core/config/vite-load.ts index 8ef15d9a2074..8939c2a8f9a4 100644 --- a/packages/astro/src/core/config/vite-load.ts +++ b/packages/astro/src/core/config/vite-load.ts @@ -6,7 +6,7 @@ import { debug } from '../logger/core.js'; async function createViteServer(root: string, fs: typeof fsType): Promise { const viteServer = await createServer({ - server: { middlewareMode: true, hmr: false, watch: { ignored: ['**'] } }, + server: { middlewareMode: true, hmr: false, watch: null }, optimizeDeps: { disabled: true }, clearScreen: false, appType: 'custom', diff --git a/packages/astro/src/core/sync/index.ts b/packages/astro/src/core/sync/index.ts index bfaed6c2f9fd..395f431771e4 100644 --- a/packages/astro/src/core/sync/index.ts +++ b/packages/astro/src/core/sync/index.ts @@ -81,7 +81,7 @@ export async function syncInternal( const tempViteServer = await createServer( await createVite( { - server: { middlewareMode: true, hmr: false, watch: { ignored: ['**'] } }, + server: { middlewareMode: true, hmr: false, watch: null }, optimizeDeps: { disabled: true }, ssr: { external: [] }, logLevel: 'silent',