I'm building a yeoman generator for simple websites. I want to include a popular JavaScript library in my scaffold.
It's easy enough with bower install <mylib>
. Bower then installs the library in the directory bower_components
.
How can configure bower to install that particular library in a particular directory?
. bowerrc file located in user's home folder ( %USERPROFILE% ) bowerrc (without the dot) file located in %APPDATA%/bower/config.
Install Bower Globally - npm install -g bower. Download & Install Git. Create your Project Directory and cd into the project directory just created.
To install Bower on Windows, you are required to install NPM (Node Package Manager) first. Using NPM, we can easily install the Bower front-end package manager. If you have installed NPM on windows, you can use the “npm install -g bower” command in the command prompt to install Bower on windows.
Install packages Bower installs packages to bower_components/ . A package can be a GitHub shorthand, a Git endpoint, a URL, and more. Read more about bower install .
Create a file called .bowerrc
in the same directory as your bower.json
with the contents:
{
"directory": "bower"
}
Bower will then install all dependencies in the directory "bower" or whatever directory you specify.
Hope that helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With