From 2c18e2d127516c2130cf50369885a30af0190d58 Mon Sep 17 00:00:00 2001 From: Phumrapee Limpianchop Date: Wed, 18 Oct 2023 12:58:49 +0700 Subject: [PATCH] fix(astro): build config from astro conflict with vite.config.js (#8852) * fix: config from astro conflict with vite * refactor: apply config on AstroBuilder.setup --- .changeset/fresh-lizards-whisper.md | 5 +++++ packages/astro/src/core/create-vite.ts | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .changeset/fresh-lizards-whisper.md diff --git a/.changeset/fresh-lizards-whisper.md b/.changeset/fresh-lizards-whisper.md new file mode 100644 index 000000000000..aa276c94626c --- /dev/null +++ b/.changeset/fresh-lizards-whisper.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Only use Vite config from astro.config.mjs as source of truth diff --git a/packages/astro/src/core/create-vite.ts b/packages/astro/src/core/create-vite.ts index 9c728301b258..fd23a27f552a 100644 --- a/packages/astro/src/core/create-vite.ts +++ b/packages/astro/src/core/create-vite.ts @@ -100,6 +100,8 @@ export async function createVite( // Start with the Vite configuration that Astro core needs const commonConfig: vite.InlineConfig = { + // Tell Vite not to combine config from vite.config.js with our provided inline config + configFile: false, cacheDir: fileURLToPath(new URL('./node_modules/.vite/', settings.config.root)), // using local caches allows Astro to be used in monorepos, etc. clearScreen: false, // we want to control the output, not Vite logLevel: 'warn', // log warnings and errors only