I checked the documentation and it didn't look like there was a way, but I couldn't explicitly tell.
I know it does and I know how to setup a Git repo itself to serve as a dependency, something like this:
- (other files)
- package.json
But what I would like to do is basically use a monorepo pattern (like Babel), so I'd have a folder structure similar to this:
- packages/
- packageA/
- package.json
- packageB/
- package.json
- packageC/
- package.json
And then be able to install them all from the same repo just referring to packageA, packageB and packageC.
I know an alternative would be to have them all be part of one module, and then import them like package/packageA, but some of them aren't super related conceptually so that is less than ideal. The only reason they are in the same repo because I don't want NPM module repos clustering up our repository.
I know this is normally done with a private NPM repository, but we currently don't have access to one, so hoping there is an alternative.
Any ideas?
packages/package.jsonnpmwill install dependencies innode_modules. You can define sub-folders innode_modulesbut not install dependencies in different folders. Maybe you want to use git submodules instead#<commit-ish>(i.e. specific git commit), or a<semver>(i.e. specific git tag) - unfortunately targeting sub-folder(s) within a git repo is not mentioned. However, in issue #4725 foryarnthe gitpkg package is mentioned that also works with npm - I haven't used it myself, maybe worth a try.