From d6014bb3e68f35fa155552801e9aec6e52713360 Mon Sep 17 00:00:00 2001 From: smeng9 <38666763+smeng9@users.noreply.github.com> Date: Thu, 2 Jan 2025 09:42:12 -0800 Subject: [PATCH] use pnp file to determine whether to rerun dependency optimization --- packages/vite/src/node/optimizer/index.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/vite/src/node/optimizer/index.ts b/packages/vite/src/node/optimizer/index.ts index 89944e96d46e08..308c962a4a2abc 100644 --- a/packages/vite/src/node/optimizer/index.ts +++ b/packages/vite/src/node/optimizer/index.ts @@ -1182,8 +1182,14 @@ const lockfileFormats = [ manager: 'yarn', }, { - // Yarn PnP - path: '.yarn/install-state.gz', + // Yarn v3+ PnP + path: '.pnp.cjs', + checkPatches: false, + manager: 'yarn', + }, + { + // Yarn v2 PnP + path: '.pnp.js', checkPatches: false, manager: 'yarn', },