From 6b48989fa8e12cc3a112a84a643b454c9d92b649 Mon Sep 17 00:00:00 2001 From: bluwy Date: Mon, 20 Mar 2023 20:56:03 +0800 Subject: [PATCH] Fix plugin apply args when filtering --- .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 000000000000..d901bc616ab4 --- /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 f4316bc2c110..32717ff7cc3c 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) => {