Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specifying latest revision of a particular branch with bower

Tags:

bower

I want to specify the latest revision of a particular branch as a dependency. Specifically, I'd like to use Bootstrap v3.0 before it is released.

What is the best way to specify that as a dependency in bower?

like image 656
Chad Avatar asked Apr 02 '13 21:04

Chad


2 Answers

You need to use the #, appended to the component name:

bower install bootstrap#version3-branch-name

And as you might expect, if you add --save-dev to that, then it will add to your bower.json file:

"bootstrap": "version3-branch-name"
like image 109
user1429980 Avatar answered Oct 26 '22 06:10

user1429980


You can specify the commit SHA instead of a version:

bower install bootstrap#37d0a30589

Note that specifying a branch in production or reusable modules is bad practice as it's a moving target and will eventually break something. Discussion about it here.

like image 43
Sindre Sorhus Avatar answered Oct 26 '22 05:10

Sindre Sorhus