Symfony bower 版本化包
Symfony bower vesionized packages
官方 symfony2 文档写道:
Bower currently does not have a "lock" feature, which means that there's no guarantee that running bower install on a different server will give you the exact assets that you have on other machines. For more details, read the article Checking in front-end dependencies.
但是我们可以初始化 bower.json 并且在那个文件中我们有与精确版本的依赖关系,比如
#bower.json
"dependencies": {
"html5shiv": "3.7.1",
"bootstrap-sass-official": "3.3.0",
}
因此,如果我使用 bower install,它应该安装包的精确版本。
我不明白为什么需要 bower.lock?
Symfony 网站会就这种情况向您发出警告。
例如,composer 中有锁定文件,因此当您在 composer.json 中定义 php 依赖项时,如下所示。
"require": {
"php": ">=5.3.3",
}
表示php版本至少要5.3.3以上
在这种情况下,锁定文件对于使服务器同步很重要。
不过在你的要求下就不用怀疑了。因为您定义了特定的次要版本“3.3.0”而没有像“~”这样的任何运算符,所以如果您使用的是确切的版本,请不用担心。
但是,如果您的供应商没有完全遵循语义版本控制,那么可能会再次出现同步问题。例如:如果在部署时有任何更改更改标记版本。但这种情况很少见,你也不应该担心。
官方 symfony2 文档写道:
Bower currently does not have a "lock" feature, which means that there's no guarantee that running bower install on a different server will give you the exact assets that you have on other machines. For more details, read the article Checking in front-end dependencies.
但是我们可以初始化 bower.json 并且在那个文件中我们有与精确版本的依赖关系,比如
#bower.json
"dependencies": {
"html5shiv": "3.7.1",
"bootstrap-sass-official": "3.3.0",
}
因此,如果我使用 bower install,它应该安装包的精确版本。 我不明白为什么需要 bower.lock?
Symfony 网站会就这种情况向您发出警告。
例如,composer 中有锁定文件,因此当您在 composer.json 中定义 php 依赖项时,如下所示。
"require": {
"php": ">=5.3.3",
}
表示php版本至少要5.3.3以上
在这种情况下,锁定文件对于使服务器同步很重要。
不过在你的要求下就不用怀疑了。因为您定义了特定的次要版本“3.3.0”而没有像“~”这样的任何运算符,所以如果您使用的是确切的版本,请不用担心。
但是,如果您的供应商没有完全遵循语义版本控制,那么可能会再次出现同步问题。例如:如果在部署时有任何更改更改标记版本。但这种情况很少见,你也不应该担心。