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', },