如何在特定目录中安装Bower依赖项? [英] How do I install bower dependencies in a specific directory?

查看:105
本文介绍了如何在特定目录中安装Bower依赖项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为简单网站构建一个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屋!

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