Specifying version numbers in Bower

安稳与你 提交于 2019-12-03 20:34:47

问题


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

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

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

Is this some sort of best practice?


回答1:


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.



来源:https://stackoverflow.com/questions/19019944/specifying-version-numbers-in-bower

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!