Hi,
I have a beginner’s question :
- A
Package A depends on Package B. Package B modifies ‘insertAsync’
- I do not use
Package B in my project but Package A.
Does that mean all inserAsync in my project will be affected the modifiction done by Package B ?
Thanks.
If Package B (the sub/transitive) dependency is “weak” or “implied” then it won’t affect your code unless you explicitly add it yourself.
api.use('package-b', ['client'], { weak: true });
api.imply('package-b', 'client')
If it’s a “strong” sub dependency, then yes it’d affect your code. Since your app automatically loads it up!
api.use('package-b', ['client']); // notice the absence of weak option
You can solve this by locally forking package-b locally and package-a would it pick it up.
Thanks. This supports my analysis
It is what i did, install package-b locally and modify it.