简体   繁体   English

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

[英]CryptoJS with Bower, how to manage this dependency?

I need to manage CryptoJS with Bower. 我需要用Bower管理CryptoJS This project is hosted on code.google.com. 此项目托管在code.google.com上。 Can be downloaded as zip file or through the SVN . 可以下载为zip文件或通过SVN下载。

Can Bower download an uncompress the zip file or download all components from the SVN and put them in the crypto folder? Bower可以下载解压缩zip文件或从SVN下载所有组件并将它们放在crypto文件夹中吗?

.bowerrc file, defining the download folder: .bowerrc文件,定义下载文件夹:

{
  "directory": "app/vendor"
}

I've tried this component.json file (fails, downloads the page itself): 我试过这个component.json文件(失败,下载页面本身):

{
  "name": "Backbone Client",
  "version": "1.0.0",
  "dependencies": {
     "crypto": "http://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/"
  }
}

Another try ( hmac.js overriders core.js and it's saved as index.js ): 另一个尝试( 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"
    }
}

Found the way reading Bower official page : 找到了阅读Bower官方网页的方式:

As you can see, packages can be installed by name, Git endpoint, GitHub shorthand, URL or local path. 如您所见,可以按名称,Git端点,GitHub简写,URL或本地路径安装软件包。 If you install from a URL that points to a zip or tar file, bower will automatically extract its contents. 如果从指向zip或tar文件的URL安装,bower将自动提取其内容。

component.json : component.json

{
  "name": "Backbone Client",
  "version": "1.0.0",
  "dependencies": {
    "crypto-js": "http://crypto-js.googlecode.com/files/CryptoJS%20v3.1.2.zip"
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM