patch package
Created: 2019-07-05 09:05:10 -0700 Modified: 2019-07-17 09:55:07 -0700
If you’ve ever felt the need to fork a git repository just to modify a couple of lines, then patch-package is probably perfect for your scenario!
Usage is easy enough by just following the instructions at the reference link. If you’re using Lerna, then you should install it at the root with the “-W” flag, e.g. “yarn add -W —dev postinstall-postinstall patch-package”.
When using this for scoped packages, you may need to do something like this:
npx patch-package @pixi/core
…if not, you may see this error message
Not creating patch file for package ‘pixi.js’
There don’t appear to be any changes.
Troubleshooting
Section titled TroubleshootingERROR Failed to apply patch for package @pixi/core
Section titled ERROR Failed to apply patch for package @pixi/coreNote: this only seems to be a problem on Windows.
I don’t know how to fix this, but I know how to work around it.
- From the root…
- Delete node_modules\pixi
- Delete node_modulespixi.js
- From the client folder…
- yarn add @pixi/particles@5.0.4 @pixi/sprite-animated@5.0.4 pixi-particles@4.1.2 pixi.js@5.0.4
↑ Just make sure that the version numbers are correct
- From the root…
- yarn
- This didn’t actually work the most recent time that I’d tried it.
Alternatively, you can just run the patch file manually from the root:
patch -p1 -i “patches/@pixi+core+5.0.4.patch”