diff --git a/.changeset/dull-poems-smoke.md b/.changeset/dull-poems-smoke.md new file mode 100644 index 0000000000..ac5ef00421 --- /dev/null +++ b/.changeset/dull-poems-smoke.md @@ -0,0 +1,5 @@ +--- +"@pnpm/plugin-commands-installation": minor +--- + +`pnpm prune` should remove the modules cache. diff --git a/packages/plugin-commands-installation/src/prune.ts b/packages/plugin-commands-installation/src/prune.ts index bb9b4726b6..8883271d8b 100644 --- a/packages/plugin-commands-installation/src/prune.ts +++ b/packages/plugin-commands-installation/src/prune.ts @@ -62,6 +62,7 @@ export async function handler ( devDependencies: opts.dev !== false, optionalDependencies: opts.optional !== false, }, + modulesCacheMaxAge: 0, pruneStore: true, storeController: store.ctrl, storeDir: store.dir, diff --git a/packages/plugin-commands-installation/test/prune.ts b/packages/plugin-commands-installation/test/prune.ts index 973616d98d..7f18612a46 100644 --- a/packages/plugin-commands-installation/test/prune.ts +++ b/packages/plugin-commands-installation/test/prune.ts @@ -73,5 +73,7 @@ test('prune removes dev dependencies', async () => { }) await project.has('is-positive') + await project.has('.pnpm/is-positive@1.0.0') await project.hasNot('is-negative') + await project.hasNot('.pnpm/is-negative@1.0.0') })