Install Bower components into two different directories?

Robb Schiller picture Robb Schiller · Apr 16, 2013 · Viewed 10.8k times · Source

When using CSS and JS components, is it possible, or even, does it make sense to install them to different directories?

.
|-- app
    |-- scripts
        |-- components           # js components go here
            |-- backbone-amd
            |-- etc
    |-- styles
        |-- modules
        |-- partials
        |-- components           # sass components go here
            |-- normalize.scss
            |-- etc

What's the most efficient way to structure a project organized as such? Is there a good Grunt task to accomplish the goal of integrating bower installed sass components for a development environment?

Answer

Sindre Sorhus picture Sindre Sorhus · Apr 17, 2013

Bower needs to keep track of every component you install. That would be very hard if they were split up in multiple locations. For Sass development, just put the components folder in the Sass search path.


There are grunt tasks that can assist you in splitting it up if you insist on doing that:

(though not recommended)