andrecardoso
andrecardoso

Reputation: 235

Is it possible to put bower.json outside root folder?

When defining a package, Is it possible to put the bower.json file inside a subdirectory of my git repository, and reference it in other projects?

I know that the docs says to put it in the root, but I already have my own directory structure on my git repository and want to put it inside a subdirectory.

I'm wondering if exists an option inside .bowerrc file to configure bower.json location. That would solve my problem.

Upvotes: 2

Views: 1748

Answers (2)

Ian
Ian

Reputation: 5883

I know this question is pretty old but none of the answers address the OP's actual question.

It is possible to store your bower.json in a subdirectory of your project (or another project for that matter).

In your .bowerrc, use the cwd (current working directory) setting to specify where your json file is stored.

More info can be found in the bower configuration docs.

Upvotes: 7

brickpop
brickpop

Reputation: 2796

Bower will create the ./bower_components folder next to the bower.json file.

So, as long as you ensure that the paths of the js/css files are OK, you can put the components wherever you want.

In my case, I have to use different versions/dependencies for an HTML5 mobile app and a Bootstrap/Angular backend. So I have something like that:

/bower.json
/bower_components/
/app/bower.json
/app/bower_components/

Just be sure to include your bower.json files in the GIT tree and add the bower_components folders to the .gitignore file

Hope it helps

Upvotes: 0

Related Questions