Bower config

27/09/2017

Bower is a package manager for the web that will help you to manage dependencies of your projects.
Bower depends on Node.js and npm. Also make sure that git is installed as some bower packages require it to be fetched and installed.

Installation

1. install node : [https://nodejs.org/en/](https://nodejs.org/en/)
2. install bower : [https://bower.io/#install-bower](https://bower.io/#install-bower)
3. optional for windows : [install powershell to be able to simply use command line](https://www.microsoft.com/fr-fr/download/details.aspx?id=40855)

Usage

Installing packages and dependencies with command line

# install dependencies listed in bower.json
$ bower install

# search dependencies
$ bower search
$ bower search 

# install a package and add it to bower.json
$ bower install  --save

# install specific version of a package and add it to bower.json
$ bower install # --save

Uninstalling packages

$ bower uninstall 

Configuration

By default Bower will download dependencies in the bower_components directory. While using json in a .bowerrc file, we can choose where the dependencies will be installed :

1. create a .bowerrc file in the root folder og your project
2. add this code and change the name of the directory where you want your package to be download :

{
    "directory": "vendors",
    "save": true,
    "save-exact": true
}

More infos on https://bower.io/docs/api/.