Surely the "components" directory should be configurable? #18

Closed
ghost opened this Issue Sep 10, 2012 · 31 comments
@ghost

Interested in using this, but surely the "components" directory should be configurable?

I usually have "js/" or "js/lib" or other.

@mobweb

+1

@Anahkiasen

+1 for this, this is the most urgent in my opinion.

@lazd

If you use a build tool like grunt, you can create a task that copies the contents of components/ to your build directory, such as build/js/lib/. Although less direct than downloading components into to your build folder, it makes more sense as you don't necessarily want to re-download your components when doing a clean build (that is, deleting the contents of your build/ folder and running your build tasks).

That said, it would be great to see this as part of Bower's configuration.

@geddski

I submitted an idea for a component types feature. This would let you install different things into different locations.

@fat

Yep agreed - we should support something a bit like npm config

@sindresorhus
Bower member

This should be fixed in #28

@Anahkiasen

Well no, with bowerrc you can configure a folder globally but not on a per-project basis.

@sindresorhus
Bower member

@Anahkiasen You're right, I just assumed it would. See my comment on that PR.

@rahar

+1

@jescalan

I really needed this for one of the apps I'm working on, so I forked bower and made the change. It was a one line change, nothing complicated at all required. Just added the following line to the exports in lib/index.js:

config: require('./core/config')

If you do this, you can call something like bower.config.directory = "vendor/js" and it will work fine. Should I even bother with a pull request? Seems like this has been open for a while, is a very simple change, and isn't being implemented...

@fat

this is fixed now with bowerrc files. the next version of bower will have this

@fat fat closed this Oct 22, 2012
@satazor
Bower member

@jenius while this is fixed with bowerrc files, the project bowerrc file is not being read at the project level
I address this here: #97

@addyosmani
Bower member
@satazor
Bower member

@addyosmani thanks :) The review process is slow though

@jescalan

@fat @satazor I know that you can use the bowerrc file, but this is not very useful for my use case, which I'll lay out briefly:

I'm integrating bower into a build system, and rather than installing js to /components I'd like to have it install into a /vendor/js folder - this makes more sense to me and fits better with the organization of the project.

It would be a pretty douchebaggy move to override ~/.bowerrc to always install to vendor/js, since people might be using bower for other things and want to have it work still. Including a .bowerrc file in every template also seems like a waste when I'm using bower's public API anyway and could configure it there without adding an extra file to every project. For me, opening up the config file through the public api solves the problem perfectly - one line of code makes the fix only for projects on this build system.

In addition, I see no reason to keep the configuration values protected. This is an open source project anyway - it's not like someone couldn't fork it and make it public anyway. Why hide away functionality?

@jescalan

Just a heads up, this was resolved in #129

@satazor
Bower member

true

@OzzyCzech

+1

Something like bower install git@.... target/dir/name will be useful

@vendethiel

Just a heads up, this was resolved in #129

no ?

@rtconner

I do not understand why "directory" isn't a directive that can be put into the bower.json file. Seems much more user friendly to do it that way.

@benschwarz
Bower member

.bowerrc

{
  "directory": "where/the/components/live"
}
@Anahkiasen

That's not what is complaint was, it's that you needed a whole other file just for a directive that is so common on half to projects that use Bower, which I agree which.

@benschwarz
Bower member

It's an .rc file — move it to ~/.bowerrc

@rtconner

Anahkiasen feels the same pain as me.
If bower is meant to make development simpler, bower itself needs to be a bit simpler.

@jimmykane

@jenius How to use your resolved thing?

@sheerun sheerun added a commit that referenced this issue Jun 10, 2016
@sheerun sheerun "Merge pull request #18 from mdasberg/master\n\nFix for Overriding .b…
…owerrc with a relative tmp path that breaks downloading of bower modules with ignores"
6339ba0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment