Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do i confirm i'm using yarn link correctly?

How can I tell my local linked package is in use rather than from remote? Is it suppose to show up in the dev server of my local package?

like image 838
stackjlei Avatar asked Jul 03 '18 20:07

stackjlei


2 Answers

If you are linking packageA into your project and wanting to confirm it is working, go to the base dir for the project and type:

ls -l node_modules/ | egrep "^l"

This will list any linked modules, each will show as:

lrwxr-xr-x 1 vagrant vagrant    66 Feb  3 14:39 packageA -> ../../../home/vagrant/.config/yarn/link/packageA

Also, if you are using VS Code, links are shown visually, if you scroll down your node_modules dir you will see:

enter image description here

like image 109
Mazerunner72 Avatar answered Oct 17 '22 08:10

Mazerunner72


If you check the yarn link documentation, the yarn link uses a local copy of the package.

This will create a symlink named react-relay/node_modules/react that links to your local copy of the react project.

like image 44
Helder Robalo Avatar answered Oct 17 '22 07:10

Helder Robalo