如何使用 Bower 将依赖项放在特定文件夹上?
How to place dependencies on a specific folder using bower?
我正在使用 bower
在我的 Project
文件夹中导入一些库。
目前在 cd Project
中使用 bower install
,正在我的 Project
文件夹中安装一个文件夹 www/lib
。
我需要删除 www/lib
并将所有依赖项放在 Project
文件夹下。
如何实现
Project
bower.json
我需要这个结构:
Project
bower.json
dojo
dijit
...
{
"name": "app",
"version": "0.0.0",
"dojoBuild": "app.profile.js",
"dependencies": {
"dojo": "~1.10.2",
"dijit": "~1.10.2",
"dojox": "~1.10.2",
"normalize-css": "~3.0.0",
"put-selector": "~0.3.6",
"util": "dojo-util#~1.10.2",
"xstyle": "~0.3.1"
},
"directory": "",
"private": true
}
Bower can be configured using JSON in a .bowerrc file. For example:
{
"directory": "app/components/", //set the directory you want here
"analytics": false,
"timeout": 120000,
"registry": {
"search": [
"http://localhost:8000",
"https://bower.herokuapp.com"
]
}
}
directory
String
The path in which installed components should be saved. If not
specified this defaults to bower_components.
"directory": "~/my-project/vendor"
我正在使用 bower
在我的 Project
文件夹中导入一些库。
目前在 cd Project
中使用 bower install
,正在我的 Project
文件夹中安装一个文件夹 www/lib
。
我需要删除 www/lib
并将所有依赖项放在 Project
文件夹下。
如何实现
Project
bower.json
我需要这个结构:
Project
bower.json
dojo
dijit
...
{
"name": "app",
"version": "0.0.0",
"dojoBuild": "app.profile.js",
"dependencies": {
"dojo": "~1.10.2",
"dijit": "~1.10.2",
"dojox": "~1.10.2",
"normalize-css": "~3.0.0",
"put-selector": "~0.3.6",
"util": "dojo-util#~1.10.2",
"xstyle": "~0.3.1"
},
"directory": "",
"private": true
}
Bower can be configured using JSON in a .bowerrc file. For example:
{
"directory": "app/components/", //set the directory you want here
"analytics": false,
"timeout": 120000,
"registry": {
"search": [
"http://localhost:8000",
"https://bower.herokuapp.com"
]
}
}
directory
String
The path in which installed components should be saved. If not specified this defaults to bower_components.
"directory": "~/my-project/vendor"