Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bower: Installing legacy bootstrap (2.3.2) with bower

I have an open source webapp using bootstrap 2.3.2 and which Currently I can't move to bootstrap 3 (completely different grid system) - I'm trying to move the webapp to use bower to handle dependencies but bower install bootstrap#2.3.2 fetches something that looks as the raw code repo not built, for example no css folder, just the seperate less files, no one minified bootstrap.min.js but multiple different plugins (not concatenated) etc..

Is this fixable? should I install differently?

like image 950
alonisser Avatar asked Jan 27 '14 08:01

alonisser


3 Answers

You are doing everything correct. Take a look at the README for v2.3.2 on github

Bootstrap includes a makefile with convenient methods for working with the framework. Before getting started, be sure to install the necessary local dependencies:

$ npm install When completed, you'll be able to run the various make commands provided:

build - make

Runs the recess compiler to rebuild the /less files and compiles the docs. Requires recess and uglify-js.

test - make test

Runs jshint and qunit tests headlessly in phantomjs (used for ci). Depends on having phantomjs installed.

watch - make watch

like image 197
Kelly J Andrews Avatar answered Jan 03 '23 13:01

Kelly J Andrews


The solution I ended up with: forked bootstrap repo, cleaned up(other branches etc..) git reset --hard to the v2.3.2 tag - checked it into another branch and pushe it to github. more cleanup (removing the old master branch, higher tags). run the build processes and setup an "updated" dist folder for the v2.3.2 tag. changed the bower package and published it as bootstrap2.3.2 package.

Now I (and everyone else) can install with bower install from this repo. The results are here if someone want to use it.

like image 20
alonisser Avatar answered Jan 03 '23 13:01

alonisser


I just ran into this and was basically setting up my own fork of Bootstrap 2.3.2 (before I noticed your answer). As I dove in, I noticed that Bootstrap 2.3.2 actually does come with pre-built assets you can use in your project. While it's not as obvious as the dist/ directory in Bootstrap 3, you can find the location of the prebuilt assets in the project's bower.json:

"main": ["./docs/assets/js/bootstrap.js", "./docs/assets/css/bootstrap.css"],

So there you go. Add {"bootstrap": "~2.3.2"} to your bower.json dependencies like you normally would, then use it like this:

<link href="bower_components/bootstrap/docs/assets/css/bootstrap.css" rel="stylesheet">
<script src="bower_components/bootstrap/docs/assets/js/bootstrap.js"></script>

No build step required.

like image 40
Joe Avatar answered Jan 03 '23 14:01

Joe