From f112c12b15dfbb278d66699f54809674dd1bded0 Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Tue, 21 Mar 2023 12:06:04 +0800 Subject: [PATCH] Fix plugin apply args when filtering (#6601) --- .changeset/tame-taxis-perform.md | 5 +++++ packages/astro/src/core/create-vite.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/tame-taxis-perform.md 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) => {