Using bower with Visual Studio Tools for Apache Co

2019-07-23 17:54发布

问题:

When I create a blank Apache Cordova app, I got a directory structure like:

root www bower.json ...

From the project root directory, if I run "bower install ionic --save", the bower dependencies were all created in the project root while I expect them to go to www.

What is the best way use bower with VSTAC projects?

回答1:

You can create a .bowerrc file at the root that has the key directory:'www/bower_components' set, indicating that the files are placed inside www instead of the root.

Visual Studio should be able to now download the dependencies inside the www folder.

Note that VS2015 also has intellisense when editing bower.json and automatically installs the dependencies too !!



回答2:

Use the following command:

npm install -g "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\ApacheCordovaTools\Packages\vs-tac"

It worked perfect for me.