javascript - How do I configure bower with Visual Studio? -
as complexity of web project growing, realizing downloading external javascript libraries manually, error prone, time consuming , making project less maintainable on time.
although visual studio has nuget package manager, not powerful bower. not external libraries being released on nuget.
but there no clear on how configure bower visual studio. please !
as complexity of web project grew, realized downloading external javascript libraries manually, error prone, time consuming , made project less maintainable on time.
although visual studio has nuget package manager, not powerful bower. not external libraries being released on nuget.
so, decided take plunge , started bower.
my project structure cleaner , easy maintain.
here listing steps, need take configure bower visual studio.
detailed steps use bower available on http://bower.io/#install-bower. here list steps, took to
— install bower
— configure visual studio
— download sample package -- ( angularjs )
bower requires node, npm , git windows.
before proceeding ahead, install following
- git windows – install https://msysgit.github.io/
- node – install https://nodejs.org/
- npm part of node (no need step)
step# 1
open command prompt , execute command
npm install -g bower
above step may fail, if behind corporate proxy server. add proxy server settings in npm, execute following 2 commands command prompt
npm config set proxy http://proxy.mycompany.com:80
npm config set https-proxy http://proxy.mycompany.com:80
once done, try installing bower again
step# 2
navigate visual studio project folder command prompt.
execute command
bower init
- include file visual studio project. may have click on “show files” solution explorer menu.
step# 3
create .bowerrc file using notepad following configuration , save in visual studio project folder
{ "directory": "scripts/bower_components", "proxy":"http://proxy.mycompany.com:80", "https-proxy":"http://proxy.mycompany.com:80" }
- include file visual studio project.
- edit file set directory packages downloaded bower
- add proxy server settings if working behind corporate proxy. else remove last 2 lines proxy , https-proxy
step# 4
to download angularjs, execute command
bower install angular –save
this add line in bower.json.
step# 5
package downloaded under bower_components directory default. (or under directory mentioned in .bowerrc file)
make sure include whole package directory in visual studio project.
- click on show files
- right click on new downloaded package , click on “include in project”
step# 6
finally add reference of new package index.html
Comments
Post a Comment