'How to switch between local and release version of dependency in monorepo?
I have a monorepo with an app and two related modules:
monorepo/app (imports module-b)
monorepo/packages/module-a (imports module-b)
monorepo/packages/module-b
module-a and module-b are also published for external usage.
What is the best way to specify module-b in the package.json of app and module-a, so I can use local version of module-b in development, but the release version of module-b when releasing app and module-a?
For example, in module-a I'm currently switching between npm install "file:../packages/module-b in local development and npm install module-b after releasing module-b, but before publishing module-a. I feel like there should be a better way to switch between local and release version of module-b.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
