Question

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

Était-ce utile?

La solution

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.

Autres conseils

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
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top