1

I'd like to use bower in install packages. I'd also like to have the packages in specific places. In particular, I'd like my javascript in '/js'.

dave dave
  • 947
  • 3
  • 10
  • 15

1 Answers1

0

You can set a custom directory for where you would like bower to install all the listed dependencies in the bower.json file. Here's a quick from bower's documentation of .bowerrc:

Custom install directory

A custom install location can be set in a .bowerrc file using the directory property. The .bowerrc file should be a sibling of your project's bower.json.

{
  "directory": "public/bower_components"
}

One of the benefits of Bower is how simple it is. One of the main downfalls of Bower is how simple it is. I do not believe that bower supports setting custom install locations for each dependency. You may have to rely on another tool to do that.

Here's a similar Stack Overflow question about install bower dependencies to different folders. While bower itself is not able to do what you ask, there are a number of tools that add such functionality:

Community
  • 1
  • 1
Alex Johnson
  • 1,504
  • 13
  • 20
  • Hey Alex. That isn't really what I want to do. Rather then putting all of my bower resources in one directory, I'd like to put specific files in specific places. For example, I'd like to put all my js files in a directory called 'js' – dave dave Jun 06 '14 at 00:17
  • I gotcha. The feature you're looking for doesn't come with bower. I've updated my answer to include a links to a [similar stack overflow question](http://stackoverflow.com/questions/16041779/is-it-possible-to-install-components-via-bower-to-two-different-directories) and a few tools that extend bower to do what you're looking for. – Alex Johnson Jun 06 '14 at 15:37