0

To make development easier it's possible to specify local NPM dependency:

{
  "dependencies": {
    "mylib": "file:/projects/mylib"
  }
}

The problem is that you required to do npm install and the mylib will be COPIED to the node_modules. So if you change mylib you need to run npm install again.

I wonder if there's a way to do the same but as a link not as a copy, so it will be the live version of the package and any change would be instantly visible?

Alex Craft
  • 13,598
  • 11
  • 69
  • 133

1 Answers1

0

To avoid using the npm link command, which works creating a symlink in the global npm folder, you can try using the npm-file-link package. It works modifying the original dependency by one to the local package using the "file:" npm feature, and you can link or unlink at a time all packages you want, whenever they are all under the same folder.

Javier Brea
  • 1,345
  • 12
  • 16