2

I have vue.js project with element-ui. All installed via npm. Now I want to change something in element-ui just to test if it works so I go in it's folder in node_modules, change code in component, run 'npm run dev' and change is not visible.

Is it in some kind of cache?

Sorry for dumb question but I am node.js noob. How can I update existing code in node_modules? I know when I run update it will go away but I just want quick test.

Do I really have to fork for that?

Space Peasant
  • 287
  • 1
  • 3
  • 16

2 Answers2

0

If you check the main entry in the package.json, in this case it's "main": "lib/element-ui.common.js". The problem can be that you've modified one of the files in the ./src folder that won't be picked up automatically until you recompile the package.

I think you should clone it's github repo, build the package and overwrite the installed one in your package's node_modules folder.

It is possible if you run npm install these changes will be overwritten from NPM and you have to copy it again.

Lajos Gallay
  • 1,169
  • 7
  • 16
0

you can change the code(example, botton.js) directly in node_modules. Note that the file (botton.js) is located in modules_name/lib/*

I have tested, it work.