与Bower一起使用CryptoJS,如何管理这种依赖?

gre*_*emo 12 javascript dependencies cryptojs bower

我需要用Bower 管理CryptoJS.此项目托管在code.google.com上.可以下载为zip文件或通过SVN下载.

Bower可以下载解压缩zip文件或从SVN下载所有组件并将它们放在crypto文件夹中吗?

.bowerrc 文件,定义下载文件夹:

{
  "directory": "app/vendor"
}
Run Code Online (Sandbox Code Playgroud)

我试过这个component.json文件(失败,下载页面本身):

{
  "name": "Backbone Client",
  "version": "1.0.0",
  "dependencies": {
     "crypto": "http://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/"
  }
}
Run Code Online (Sandbox Code Playgroud)

另一个尝试(hmac.js覆盖core.js和它保存为index.js):

{
  "name": "Backbone Client",
  "version": "1.0.0",
  "dependencies": {
    "crypto":
       "http://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/core.js",
    "crypto":
       "http://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/hmac.js"
    }
}
Run Code Online (Sandbox Code Playgroud)

gre*_*emo 21

找到了阅读Bower官方网页的方式:

如您所见,可以按名称,Git端点,GitHub简写,URL或本地路径安装软件包.如果从指向zip或tar文件的URL安装,bower将自动提取其内容.

component.json:

{
  "name": "Backbone Client",
  "version": "1.0.0",
  "dependencies": {
    "crypto-js": "http://crypto-js.googlecode.com/files/CryptoJS%20v3.1.2.zip"
  }
}
Run Code Online (Sandbox Code Playgroud)