Fix plugin apply args when filtering (#6601)

This commit is contained in:
Bjorn Lu 2023-03-21 12:06:04 +08:00 committed by GitHub
parent 0344465dea
commit f112c12b15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Fix plugin apply args when filtering

View file

@ -196,7 +196,7 @@ export async function createVite(
const applyToFilter = command === 'build' ? 'serve' : 'build'; const applyToFilter = command === 'build' ? 'serve' : 'build';
const applyArgs = [ const applyArgs = [
{ ...settings.config.vite, mode }, { ...settings.config.vite, mode },
{ command, mode }, { command: command === 'dev' ? 'serve' : command, mode },
]; ];
// @ts-expect-error ignore TS2589: Type instantiation is excessively deep and possibly infinite. // @ts-expect-error ignore TS2589: Type instantiation is excessively deep and possibly infinite.
plugins = plugins.flat(Infinity).filter((p) => { plugins = plugins.flat(Infinity).filter((p) => {