Reputation: 1
I am creating an angular library, which is internally using the vtk.js library. I tried adding vtk.js as a peer dependency. But on installing my custom package, it is showing a warning to install vtk.js as well.
Is there any way I can make sure that the vtk.js package will also get packed inside my angular package?
Upvotes: 0
Views: 140
Reputation: 462
You can express dependencies of your library in a 2 ways (actually 3 but devDependencies
is pretty self-explained so we omit them)
peerDependencies
- you can use this type of dependency if you need to express the following things:node_module
contains few versions of the dependency (because of so called transitive dependency this case is possible)As you mentioned peerDependencies
is not installed automatically, instead it will warn a consumer of you lib about missing dependency or incompatible version of it
2.dependencies
- use dependencies if you do not care about the cases described above. Having vtk.js
here guarantee that it will be installed automatically for every consumer of your lib
Upvotes: 1