Patching packages in Yarn berry

At one point, patching a package in Yarn was as simple as yarn patch <package-name> and following the prompts. Now, it’s riddled with unintuitive bugs. Let’s walk through it.

Patching the package

To prepare the package for patching, run yarn patch <package-name>. The command output should specify a temporary directory for you to edit. Make the desired changes to the package in that directory, then follow the subsequent command in the output: yarn patch-commit -s <directory>.

Verifying the results

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Charles Stover

Charles Stover

Staff front end engineer | Tech lead | Architect | charlesstover.com