在Bower中指定版本号

编程入门 行业动态 更新时间:2024-10-17 19:21:16
本文介绍了在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中指定版本号

本文发布于:2023-11-16 11:40:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1603958.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:版本号   Bower

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!