如何在特定目录中安装Bower依赖项? [英] How do I install bower dependencies in a specific directory?
问题描述
我正在为简单网站构建一个yeoman生成器。
我想在我的支架中包含一个流行的JavaScript库。
I'm building a yeoman generator for simple websites. I want to include a popular JavaScript library in my scaffold.
使用 bower install< mylib>
很容易。然后Bower将库安装在目录 bower_components
中。
It's easy enough with bower install <mylib>
. Bower then installs the library in the directory bower_components
.
如何配置Bower将特定库安装在特定目录中目录?
How can configure bower to install that particular library in a particular directory?
推荐答案
在同一目录中创建名为 .bowerrc
的文件作为您的 bower.json
,内容如下:
Create a file called .bowerrc
in the same directory as your bower.json
with the contents:
{
"directory": "bower"
}
然后,Bower将所有依赖项安装在目录 bower或您指定的任何目录。
Bower will then install all dependencies in the directory "bower" or whatever directory you specify.
希望有帮助!
这篇关于如何在特定目录中安装Bower依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!