Files
pnpm/pnpm11/patching/config
Zoltan Kochan ffc51c8f4a perf(lockfile): apply patchedDependencies changes without resolving (#13680)
Resolution never reads a patch. It appends the patch file's hash to an
already-resolved package id, so a `patchedDependencies` change leaves the
set of packages and versions untouched and moves only the affected keys.
Rewrite those keys and the references pointing at them instead of
re-resolving.

`packages:` is keyed without the patch hash, so only `snapshots:`, the
importers' resolved versions, and dependents' dependency references move.
The patched tarball is already in the store, so materialization applies
the patch with no network access, and the new depPath puts the package in
a fresh virtual-store slot so an install script reruns against the
patched sources.

Fall back to the resolver when the patched package is reachable as a peer
(its depPath is embedded in dependents' peer suffixes), when a peer suffix
was shortened into a hash and cannot be inspected, when the new
configuration would leave a patch unused while `allowUnusedPatches` is
off, and when a patch file cannot be read.

Implemented in both the TypeScript CLI and pacquet.

Related to pnpm/pnpm#13474.
2026-08-06 22:39:19 +02:00
..

@pnpm/patching.config

Functions related to patching configurations

npm version

Installation

pnpm add @pnpm/patching.config

License

MIT