【发布时间】:2013-04-02 21:22:33
【问题描述】:
我想将特定分支的最新版本指定为依赖项。具体来说,我想在 Bootstrap v3.0 发布之前使用它。
在 bower 中将其指定为依赖项的最佳方法是什么?
【问题讨论】:
标签: bower
我想将特定分支的最新版本指定为依赖项。具体来说,我想在 Bootstrap v3.0 发布之前使用它。
在 bower 中将其指定为依赖项的最佳方法是什么?
【问题讨论】:
标签: bower
您需要使用#、appended to the component name:
bower install bootstrap#version3-branch-name
如您所料,如果您将--save-dev 添加到其中,那么它将添加到您的bower.json 文件中:
"bootstrap": "version3-branch-name"
【讨论】:
"ckeditor": "#basic/latest" 代表github.com/ckeditor/ckeditor-releases
您可以指定提交 SHA 而不是版本:
bower install bootstrap#37d0a30589
请注意,在生产或可重用模块中指定分支是不好的做法,因为它是一个移动目标,最终会破坏某些东西。讨论一下here。
【讨论】:
<library>#<branch_name>吗?
直到 bower 能够 target a specific commit @Sindre 指出的那样,我正在利用 bower 定位任意 zip 文件的能力。我在我的 component.json 中指定了 github 的 bootstrap 3.0 分支的 zip:
"bootstrap": "https://github.com/twbs/bootstrap/archive/3.0.0-wip.zip"
我知道这是针对分支(而不是特定提交)的不好做法,但这对我来说现在是权宜之计。
【讨论】: