How do I change the files installed by node modules to the project directory in the vue project?

introduced a plug-in into the project, but the effect of the plug-in is somewhat different from that of the requirements, so the code of the plug-in is changed, but the files uploaded to the node_modules in the test server remain the same. If directly in the test branch to change the file in the node_modules will be very cumbersome. The node_modules folder is ignored in the project. Now think about how you can change the plug-ins in node_modules to the code of the project itself. How to operate, but also pay attention to the point?

Mar.24,2021

did you get the source code of the project to the server and then npm install ?

pull out the plug-in code that needs to be modified in node_modules, build a code repository, maintain it yourself, and change it as much as you want. Then in the package.json of the original project, change the place where the code is referenced.

the previous package.json contains the following

...
"dependencies": {
    ...
    "": "^2.2.1",
    ...
  },
...

you pull out the plug-in code, build your own repository, and then change the references in package.json to the following,

...
"dependencies": {
    ...
    "": "git+ssh://xxxxxxxxxx.git", // git
    ...
  },
...

when you modify the code of the plug-in, just re-enter npm install in the project

.
Menu