Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 869 Bytes

pnpm-patch.md

File metadata and controls

28 lines (20 loc) · 869 Bytes

Make changes to a dependency using pnpm patch

pnpm patch allows you to make changes to a dependency package without having to wait for the package maintainers to release the changes.

It first extracts the package into a temporarily directory and asks you to make the changes.

$ pnpm patch [email protected]
You can now edit the following folder: /tmp/5ea276f0eeb3585ea64ddf4b3b7ef377

Once you've made the changes, you patch up the changes using pnpm patch-commit:

$ pnpm patch-commit /tmp/5ea276f0eeb3585ea64ddf4b3b7ef377

This will create a patchfile in your project and pnpm will use this each time you do an pnpm install.

pnpm will reference patches in package.json:

"pnpm": {
  "patchedDependencies": {
    "[email protected]": "patches/[email protected]"
  }
}