最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - CryptoJS with Bower, how to manage this dependency? - Stack Overflow

programmeradmin9浏览0评论

I need to manage CryptoJS with Bower. This project is hosted on code.google. Can be downloaded as zip file or through the SVN.

Can Bower download an uncompress the zip file or download all components from the SVN and put them in the crypto folder?

.bowerrc file, defining the download folder:

{
  "directory": "app/vendor"
}

I've tried this component.json file (fails, downloads the page itself):

{
  "name": "Backbone Client",
  "version": "1.0.0",
  "dependencies": {
     "crypto": ".1.2/build/components/"
  }
}

Another try (hmac.js overriders core.js and it's saved as index.js):

{
  "name": "Backbone Client",
  "version": "1.0.0",
  "dependencies": {
    "crypto":
       ".1.2/build/components/core.js",
    "crypto":
       ".1.2/build/components/hmac.js"
    }
}

I need to manage CryptoJS with Bower. This project is hosted on code.google.com. Can be downloaded as zip file or through the SVN.

Can Bower download an uncompress the zip file or download all components from the SVN and put them in the crypto folder?

.bowerrc file, defining the download folder:

{
  "directory": "app/vendor"
}

I've tried this component.json file (fails, downloads the page itself):

{
  "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):

{
  "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"
    }
}
Share Improve this question asked Feb 7, 2013 at 15:14 gremogremo 48.9k80 gold badges269 silver badges447 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 21

Found the way reading Bower official page:

As you can see, packages can be installed by name, Git endpoint, GitHub shorthand, URL or local path. If you install from a URL that points to a zip or tar file, bower will automatically extract its contents.

component.json:

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

评论列表(0)

  1. 暂无评论