Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent Vite watching on Astro config load #7171

Merged
merged 2 commits into from May 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/orange-lizards-report.md
@@ -0,0 +1,5 @@
---
'astro': patch
---

Prevent Vite watching on Astro config load
2 changes: 1 addition & 1 deletion packages/astro/src/core/config/vite-load.ts
Expand Up @@ -10,7 +10,7 @@ export interface ViteLoader {

async function createViteLoader(root: string, fs: typeof fsType): Promise<ViteLoader> {
const viteServer = await vite.createServer({
server: { middlewareMode: true, hmr: false },
server: { middlewareMode: true, hmr: false, watch: { ignored: ['**'] } },
optimizeDeps: { disabled: true },
clearScreen: false,
appType: 'custom',
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/core/sync/index.ts
Expand Up @@ -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: ['**/*'] } },
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As explained in the PR description, this isn't needed, but I updated anyways so it's consistent with the createViteLoader code.

optimizeDeps: { disabled: true },
ssr: { external: [] },
logLevel: 'silent',
Expand Down