在Bower中指定版本号 [英] Specifying version numbers in Bower

查看:109
本文介绍了在Bower中指定版本号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编写bower.json时,您可以在依赖项中指定版本号。
有时我看到有人写作

When writing bower.json you can specify version numbers in your dependencies. Sometimes I see people writing

{
...
    "devDependencies" : {
        "grunt" : "~0.3.13",
    }
}

究竟是什么意思?为什么不写> = 0.3.13?

What exactly does the ~ mean? Why not write >=0.3.13?

这是某种最佳做法吗?

Is this some sort of best practice?

推荐答案

这是 semver 和符号与> = 0.3.13< 0.4.0 相同,它将匹配所有补丁 0.3.13 之后发布,但不包括 0.4.0 。这意味着您将获得错误修复(补丁),但不是新功能(次要)。不建议使用> = 0.3.13 ,因为它会匹配任何超出某些时间点的内容。

It's semver and the notation is the same as >=0.3.13 <0.4.0, which will match all patch releases after and including 0.3.13, but not 0.4.0. This means you'll get bug fixes (patch), but not new features (minor). >=0.3.13 is not recommended as it will match anything above which will at some point break.

这篇关于在Bower中指定版本号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆