Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the advantage of using Bower to install all the package content I don´t even need? [closed]

Imagine I would like to use plugins like angular.js and html5shiv on my website. I could now use bower to install these packages together with all the unnecessary files inside those packages or I could simply include the cdn hosted files from Google or Cloudflare. So could somebody please tell me what would be the advantage of adding all necessary plugins to the bower.json and then having to manually get the .js file from the packages which I would need to include in my HTML file. Isn´t that much more complicated and resource consuming?

Example: why should I add angular.js to the bower.json and let it download the whole Angular package including Gruntfile, all dependencies and assets (9MB!) and so on instead of adding one single line to my HTML file.

When does it make sense at all to use Bower? The only advantage I see is for other developers to see the dependencies of your project...

like image 593
Chris Avatar asked Sep 20 '14 09:09

Chris


1 Answers

True is that for using only one library bower is overkill. Case where bower shines are when you are multiple libraries, and some of them depends on each other. Like you have:

  • angular
  • jquery
  • select2
  • angular-ui
  • angular-route-segment

angular-ui/ui-utils describe their dependency as:

"angular": ">= 1.0.2"

it will accept any angular version greater then 1.0.2. I your project, or any of your dependencies specify angular version to something smaller then 1.0.2, bower will prompt and ask how to solve the conflict.

like image 140
Marcin Wosinek Avatar answered Sep 22 '22 02:09

Marcin Wosinek