RaveJS / rave

Zero-configuration application bootstrap and development
278 stars 8 forks source link

Rave fails to load bower components installed in a directory other than the default "bower_components" directory. #48

Open teehemkay opened 10 years ago

teehemkay commented 10 years ago

bower_components is the default directory where bower stores components.

But Bower also allows for a custom install directory that can be specified with the directory property in a .bowerrc file which is a sibling of bower.json in the project directory.

unscriptable commented 10 years ago

In a convoluted way, this feature depends on #50. We will have to do #50 first. Just FYI.

unscriptable commented 10 years ago

There are two reasons rave cannot automatically find .bowerrc:

  1. It may not be adjacent to bower.json. It could be in a parent folder, outside of the web root.
  2. Almost all web servers refuse to serve hidden files (those with a leading dot) by default.

So, it seems a reasonable way to provide this feature is via a config option. Something like:

<!doctype html>
<html data-rave-bower-root="client/this_is_not_bower_components">...</html>

and

{
    "rave": {
        "bower_root": "client/this_is_not_bower_components"
    }
}

Anybody have any thoughts about this?

unscriptable commented 10 years ago

@briancavalier suggested rave.bowerrc.dir, a much more precise and obvious name.

Actually, I think rave.bowerrc.directory is the most precise. Wondering if it's too verbose and/or too nested:

<!doctype html>
<html data-rave-bowerrc-directory="client/this_is_not_bower_components">...</html>

and

{
    "rave": {
        "bowerrc": { 
            "directory": "client/this_is_not_bower_components"
        }
    }
}
briancavalier commented 10 years ago

Good call on rave.bowerrc.directory, might as well match it exactly if we go that route.

Another possibility would be to stick with something bower-specific, but not match .bowerrc exactly, ie something that is just a bit more abstract but still fairly obvious, like rave.bower.root. That'd still be applicable if bower decided to change bowerrc.

teehemkay commented 10 years ago

+1 on rave.bower.root.

gabrielalan commented 9 years ago

This feature will be implemented? I'm trying to use rave.js on a existing project, but the bowerrc directory, is changed...

unscriptable commented 9 years ago

This feature seems easy to add but I just don't have the time atm. Anybody want to send a PR?