Skip to content

Commit

Permalink
Disable file watcher for internal one-off vite servers
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Jan 11, 2024
1 parent 8059a19 commit c98ae0c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/blue-pets-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"astro": patch
---

Disables internal file watcher for one-off Vite servers to improve start-up performance
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 @@ -6,7 +6,7 @@ import { debug } from '../logger/core.js';

async function createViteServer(root: string, fs: typeof fsType): Promise<ViteDevServer> {
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',
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 @@ -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',
Expand Down

0 comments on commit c98ae0c

Please sign in to comment.