The npm community forum has been discontinued.
To discuss usage of npm, visit the GitHub Support Community.
How to set git clone options using git+https dependency in package.json
For example I got dependency:
when I run npm install, npm clones full github.com/saby/TypeScript repository with all branches and history.
I want npm to use git clone https://github.com/saby/TypeScript.git --depth 1 --single-branch --branch rc-19.500 instead of full cloning.
How can I do that?
Wouldn’t this approach fail if the hash portion isn’t a branch? You can also put tag names, commit hashes, or
semver:<range> (which selects among semver tags). I don’t know how we’d do that without fetching all the refs, but I might be missing some git trick?