How to modify node_modules
Why modify node_modules? In normal development, it is rarely necessary to change the code in node_modules, but there are many cases that need to be modified. For example, I encountered a scene last time, I used a middleware package for interface forwarding, but I encountered a problem: this package limits the uploaded file format But in fact, I want to let go of uploading all file formats, so I am forced to modify the code of this package in node_modules and let go of its restrictions, so as to achieve the effect I want, so how should I change it? This is a problem The first method: direct change This is easy to understand, just go directly to node_modules, find the code of that package, modify the code in the corresponding place, and then restart the project to achieve the effect I want. But in fact, this approach has too many disadvantages! 1. You can only use the code you modified locally, and your colleagues cannot use it 2. After the next npm i, the code of the package will b...