将 bower 与 Visual Studio Tools for Apache Cordova 结合使用 [英] Using bower with Visual Studio Tools for Apache Cordova

查看:23
本文介绍了将 bower 与 Visual Studio Tools for Apache Cordova 结合使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我创建一个空白的 Apache Cordova 应用程序时,我得到了如下目录结构:

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

根万维网凉亭.json...

root www bower.json ...

从项目根目录,如果我运行bower install ionic --save",bower 依赖项都在项目根目录中创建,而我希望它们转到 www.

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.

在 VSTAC 项目中使用 bower 的最佳方式是什么?

What is the best way use bower with VSTAC projects?

推荐答案

您可以创建一个 .bowerrc 文件 在设置了键 directory:'www/bower_components' 的根目录下,表示文件放置在 www 而不是根目录中.

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 现在应该能够下载 www 文件夹中的依赖项.

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

注意VS2015在编辑bower.json时也有intellisense,也会自动安装依赖!!

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

这篇关于将 bower 与 Visual Studio Tools for Apache Cordova 结合使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆