by warent · 4y ago · 0 comments
https://www.npmjs.com/package/patch-package
You commit your changes as a diff text file and add the patch-package command to your post-install hook so it runs after every install
My main use for it is fixing other packages' package.json exports field and Typescript definitions
Where should one put the text files in the code base? Do you create some root level "patch" directory?
That’s also how I would share any patches: Just apply them when needed during the build process. NPM doesn’t care about what changes inside packages, so you can hack them all you want.
A popular choice if you need some pr's that aren't (going to be) merged.