React: Patching package.json using patch-package

Viewed 1089

I am using the patch-package to patch a package.json file of one of my dependencies. I modified the package.json and ran npx patch-package [dependency_name] but it not capturing the changes made to the package.json. However, changes made to other files like index.js are captured. How do I patch the package.json? I am trying to modify the module and jsnext:main attributes.

2 Answers

I was trying to use this for the same purpose, alas the answer is no from what I can tell.

The patch process comes after postinstall which means that the package.json is already processed with the invalid dependencies.

Aside from just creating a PR, I revendored the library and made my modifications as I cannot wait for a merge.

Related