Bower Custom install directory

Hey I am new to using bower and I am trying to give a custom install directory.

Looking at the documentation I have made a file a.bowerrc and within it has "{ "directory": "js/lib" }"

But when I run bower install it just creates the bower components folder within my main folder

Do I have to place the .bowerrc file somewhere different? or add more to file path?

My file structure is

main -folder a.bowerrec -file bower.json -file js -folder lib -folder


Looks like your filename is "a.bowerrec"? It should be just ".bowerrc", you'll have to rename it.

The file should be placed in your projects root directory with your bower.json file.

You should find this answer for changing bower's default component directory useful.


Example directory = public/components

Example package = jquery

Either create a dotfile .bowerrc and drop in {"directory": "public/components"} or use the bower install command adding a --config.directory=public/components flag.

To create the dotfile:

Windows (CLI):

echo {"directory": "public/components"} >> .bowerrc

Unix:

echo '{"directory": "public/components"}' >> .bowerrc

To run directly (both OS's):

bower install --save --config.directory=public/components jquery
链接地址: http://www.djcxy.com/p/20094.html

上一篇: 安装角度

下一篇: Bower自定义安装目录