Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Solutions for installing libraries without a prebuilt file in bower

Tags:

bower

Some libraries don't have an already build JavaScript file in their Github repository because the authors of these libraries are against keeping build artifacts around (Sinon.JS for example). Is there a preferred way to deal with this using Bower?

I know that I could fork the repository and register my fork with the prebuilt file with Bower. I'm just not sure if this is the best/correct way to handle this.

like image 520
Aaron Avatar asked Apr 15 '13 18:04

Aaron


1 Answers

If there's not a proper Bower package registeres, you can install from any git repo (you can specify versions if there are proper git tags), and even from a .zip or .tar.gz files if you provide an url. This is from http://bower.io/

bower install <package>

Where <package> can be any one of the following:

  • A name that maps to a package registered with Bower, e.g, jquery.
  • A remote Git endpoint, e.g., git://github.com/someone/some-package.git. Can be public or private.
  • A local Git endpoint, i.e., a folder that's a Git repository.
  • A shorthand endpoint, e.g., someone/some-package (defaults to GitHub).
  • A URL to a file, including zip and tar.gz files. It's contents will be extracted.

Of course you won't get any dependency resolution this way, but you can take care of that manually adding any dependency explicitly to your bower.json file

like image 188
Benja Avatar answered Sep 18 '22 08:09

Benja