I have a repo with various components and I want to be able to include the components as individual dependencies (but I don't want to create a repo per component).
Is it a way to use a subfolder of a github repo as the path for a dependency in npm ? (that will not involve creating separate branches per component)
Something like
dropdown: git+https://[email protected]/me/mycomponents.git/components/dropdown
You kinda can.
Since version 1.7.0 git supports sparse checkouts, which is exactly what you want. Unfortunately npm doesn't have anything in set to support it, so you have to do it manually. Given you want to add Node/core
from BotBuilder, add this to your package.json
:
"scripts": {
"postinstall": "mkdir BotBuilder; cd BotBuilder; git init; git remote add -f origin https://github.com/Microsoft/BotBuilder.git; git config core.sparseCheckout true; echo \"Node/core\" >> .git/info/sparse-checkout; git pull --depth=1 origin master; cd ..; npm i ./BotBuilder/Node/core/"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With