diff --git a/.changeset/tame-taxis-perform.md b/.changeset/tame-taxis-perform.md new file mode 100644 index 000000000..d901bc616 --- /dev/null +++ b/.changeset/tame-taxis-perform.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix plugin apply args when filtering diff --git a/packages/astro/src/core/create-vite.ts b/packages/astro/src/core/create-vite.ts index f4316bc2c..32717ff7c 100644 --- a/packages/astro/src/core/create-vite.ts +++ b/packages/astro/src/core/create-vite.ts @@ -196,7 +196,7 @@ export async function createVite( const applyToFilter = command === 'build' ? 'serve' : 'build'; const applyArgs = [ { ...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. plugins = plugins.flat(Infinity).filter((p) => {