diff --git a/.changeset/green-rivers-speak.md b/.changeset/green-rivers-speak.md new file mode 100644 index 000000000000..777486878e51 --- /dev/null +++ b/.changeset/green-rivers-speak.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Refactors Vite config to avoid Vite 5.1 warnings diff --git a/packages/astro/src/core/config/vite-load.ts b/packages/astro/src/core/config/vite-load.ts index 8939c2a8f9a4..69545f0cda47 100644 --- a/packages/astro/src/core/config/vite-load.ts +++ b/packages/astro/src/core/config/vite-load.ts @@ -7,7 +7,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: null }, - optimizeDeps: { disabled: true }, + optimizeDeps: { noDiscovery: true }, clearScreen: false, appType: 'custom', ssr: { diff --git a/packages/astro/src/core/sync/index.ts b/packages/astro/src/core/sync/index.ts index 395f431771e4..8b78c9d306cd 100644 --- a/packages/astro/src/core/sync/index.ts +++ b/packages/astro/src/core/sync/index.ts @@ -82,7 +82,7 @@ export async function syncInternal( await createVite( { server: { middlewareMode: true, hmr: false, watch: null }, - optimizeDeps: { disabled: true }, + optimizeDeps: { noDiscovery: true }, ssr: { external: [] }, logLevel: 'silent', },