Search code examples
node.jsgitrepositorybowerbower-install

Bower - Give different path to a registered package


I have my own cloned git repository. (I'll use cloned jquery to simplify)

I want to be able to link a Registered package name to a given path so I could do this:

"jquery": "1.0.0"


I know it is possible to just give the path, i.e

bower install myJqueryPath

OR, add to dependencies on bower.json

"jquery": "myJqueryPath"


But again, these solutions are not what i'm looking for. I want to let bower know not to install jquery (or any other package) from github. But to install to it from a given repository.

Thanks :)

(I know it is possible, i don't know how)


Solution

  • Ok, after further review, the secret lies in the .bowerrc file.
    The .bowerrc file has a field called registry which is responsible for telling bower:

    My man, go look for packages in the following link:

    It's supposed to look something like this:

      {
         "registry": {
            "search": [
               "http://localhost:8080/"
            ]
         }
      }
    

    This tells bower to go search for packages in some kind of a copy to bower's default repository. (jquery example).

    Now, when bower knows to go look for packages in my path instead of it's default path I can finally use:

    bower install jquery

    and, as wanted, it will install it from my path.
    plus, I can add bower's defualt repository as my second option.

    small note:
    using
    "registry": "http://localhost:8080/" is also fine.