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.
React: Patching package.json using patch-package
6.7k Views Asked by kunji mamu At
        	2
        	
        There are 2 best solutions below
0
                 On
                        
                            
                        
                        
                            On
                            
                                                    
                    
                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.
https://github.com/ds300/patch-package/issues/49#issuecomment-646581987