From 79ba74832fc46e6946c8235c33e9acfbb3a4139b Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Tue, 23 May 2023 22:40:40 +0800 Subject: [PATCH] Prevent Vite watching on Astro config load (#7171) --- .changeset/orange-lizards-report.md | 5 +++++ packages/astro/src/core/config/vite-load.ts | 2 +- packages/astro/src/core/sync/index.ts | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/orange-lizards-report.md diff --git a/.changeset/orange-lizards-report.md b/.changeset/orange-lizards-report.md new file mode 100644 index 0000000000..69da198cb1 --- /dev/null +++ b/.changeset/orange-lizards-report.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Prevent Vite watching on Astro config load diff --git a/packages/astro/src/core/config/vite-load.ts b/packages/astro/src/core/config/vite-load.ts index df9cfffe95..a4fc5e9a6e 100644 --- a/packages/astro/src/core/config/vite-load.ts +++ b/packages/astro/src/core/config/vite-load.ts @@ -10,7 +10,7 @@ export interface ViteLoader { async function createViteLoader(root: string, fs: typeof fsType): Promise { const viteServer = await vite.createServer({ - server: { middlewareMode: true, hmr: false }, + server: { middlewareMode: true, hmr: false, watch: { ignored: ['**'] } }, 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 0828f8ff37..95377eeb85 100644 --- a/packages/astro/src/core/sync/index.ts +++ b/packages/astro/src/core/sync/index.ts @@ -65,7 +65,7 @@ export async function sync( const tempViteServer = await createServer( await createVite( { - server: { middlewareMode: true, hmr: false }, + server: { middlewareMode: true, hmr: false, watch: { ignored: ['**'] } }, optimizeDeps: { disabled: true }, ssr: { external: [] }, logLevel: 'silent',