문제

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top