terminalbowermultiple-versions

Bower: Install 2 versions of jQuery


How would I go about installing 2 versions of jQuery using bower? I want to have v2.0 as well as 1.9.1 for browser support fallback

The issue I'm having is that if you run bower install jquery#1.9.1 jquery#2.0.0 the first version gets overwritten by the second because they are the same component


Solution

  • In the dependencies part of your bower.json you can have something like this:

    "dependencies": {
        "jquery": "2.0.0",
        "jquery-1.9.1": "http://code.jquery.com/jquery-1.9.1.js"
    }
    

    One shouldn't normally have to do this, but sometimes you have to maintain / migrate an existing website that (for whatever reason) uses different versions of jquery in different pages!