diff options
author | 2023-10-18 12:58:49 +0700 | |
---|---|---|
committer | 2023-10-18 06:58:49 +0100 | |
commit | 2c18e2d127516c2130cf50369885a30af0190d58 (patch) | |
tree | 4cb9e66cf5510f2d6540690ed3c73ab5d2c2ab17 | |
parent | 3baab3d93b8d16517cb089b0fa2c4028f21e780f (diff) | |
download | astro-2c18e2d127516c2130cf50369885a30af0190d58.tar.gz astro-2c18e2d127516c2130cf50369885a30af0190d58.tar.zst astro-2c18e2d127516c2130cf50369885a30af0190d58.zip |
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
-rw-r--r-- | .changeset/fresh-lizards-whisper.md | 5 | ||||
-rw-r--r-- | packages/astro/src/core/create-vite.ts | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/.changeset/fresh-lizards-whisper.md b/.changeset/fresh-lizards-whisper.md new file mode 100644 index 000000000..aa276c946 --- /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 9c728301b..fd23a27f5 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 |