How to change src code of Vue in node_modules for testing

Viewed 284

I am using Vue 2 (doesn't really matter which version exactly).

I want to test some things that happen behind the hood in Vue. So I decided to add console.log('test123') in Vue's files in node_modules. It turns out that the console log never fires. I put that in all files of Vue in node_modules, even in all files of dist's folder of Vue.

How can I achieve this ? If I fork the repo, then I'd have to upload new versions each time on my repo and then run npm install. I know that will work but wanted to achieve this without forking.

Any ideas what I am missing ?

1 Answers

there are many ways .. but i feel more comfortable using this method :
you can download any npm package in a seperated folder next to your project...
open the folder of the package then run this in the terminal:

npm link

then open the project folder and run

npm link ../package-path     # link the dir of your dependency

References npm-link
How to test an npm package locally

Related