-
How would a setup for publishing a package and related Now I have an Nx workspace with a The lib that I want to publish has no dependencies in it's |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
That's a good question. My experience with Nx tells me that you need to list the dependencies of your library on the library's package.json. That doesn't mean that you will remove the dependencies from the workspace root. The dependencies on the library's package.json indicate NPM what it needs to install when installing your library. That process is automatically managed by npm when installing your library. If you don't do that and you are using RxJs, for instance, what would happen is that in run time, your library will throw an exception indicating that RxJs was not found. |
Beta Was this translation helpful? Give feedback.
That's a good question.
My experience with Nx tells me that you need to list the dependencies of your library on the library's package.json.
That doesn't mean that you will remove the dependencies from the workspace root. The dependencies on the library's package.json indicate NPM what it needs to install when installing your library. That process is automatically managed by npm when installing your library.
If you don't do that and you are using RxJs, for instance, what would happen is that in run time, your library will throw an exception indicating that RxJs was not found.