bower.json中的~和^有什么区别?
What is the difference between ~ and ^ in bower.json?
我有这个 bower.json 文件。
{
"name": "angular-seed",
"description": "A starter project for AngularJS",
"version": "0.0.0",
"homepage": "https://github.com/angular/angular-seed",
"license": "MIT",
"private": true,
"dependencies": {
"angular": "~1.4.0",
"angular-route": "~1.4.0",
"angular-loader": "~1.4.0",
"angular-mocks": "~1.4.0",
"html5-boilerplate": "~5.2.0",
"angular-google-chart": "^0.1.0",
"angular-material": "^1.0.6"
}
}
对于某些依赖项,我将 ^ 视为 "angular-material": "^1.0.6"
。对于其他人,我将 ~ 视为 "html5-boilerplate": "~5.2.0"
。 ^ 和 ~ 有什么区别?
都是关于semver and it actually comes from npm's package.json:
- ~版本是"Approximately equivalent to version"
- ^版本是"Compatible with version"
我有这个 bower.json 文件。
{
"name": "angular-seed",
"description": "A starter project for AngularJS",
"version": "0.0.0",
"homepage": "https://github.com/angular/angular-seed",
"license": "MIT",
"private": true,
"dependencies": {
"angular": "~1.4.0",
"angular-route": "~1.4.0",
"angular-loader": "~1.4.0",
"angular-mocks": "~1.4.0",
"html5-boilerplate": "~5.2.0",
"angular-google-chart": "^0.1.0",
"angular-material": "^1.0.6"
}
}
对于某些依赖项,我将 ^ 视为 "angular-material": "^1.0.6"
。对于其他人,我将 ~ 视为 "html5-boilerplate": "~5.2.0"
。 ^ 和 ~ 有什么区别?
都是关于semver and it actually comes from npm's package.json:
- ~版本是"Approximately equivalent to version"
- ^版本是"Compatible with version"