Depend on a branch or tag using a git URL in a package.json?

前端 未结 5 1111
眼角桃花
眼角桃花 2020-11-29 15:49

Say I\'ve forked a node module with a bugfix and I want to use my fixed version, on a feature branch of course, until the bugfix is merged and released.

How would I

5条回答
  •  借酒劲吻你
    2020-11-29 16:35

    If you want to use devel or feature branch, or you haven’t published a certain package to the NPM registry, or you can’t because it’s a private module, then you can point to a git:// URI instead of a version number in your package.json:

    "dependencies": {
       "public": "git://github.com/user/repo.git#ref",
       "private": "git+ssh://git@github.com:user/repo.git#ref"
    }
    

    The #ref portion is optional, and it can be a branch (like master), tag (like 0.0.1) or a partial or full commit id.

提交回复
热议问题