Bower: Install 2 versions of jQuery

后端 未结 4 1783
忘了有多久
忘了有多久 2020-12-02 05:38

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

4条回答
  •  心在旅途
    2020-12-02 06:15

    According to the bower docs

    Bower offers several ways to install packages:

    # Using the dependencies listed in the current directory's bower.json
    bower install
    # Using a local or remote package
    bower install 
    # Using a specific version of a package
    bower install #
    # Using a different name and a specific version of a package
    bower install =#
    

    You can install two different versions of jQuery like so:

    bower install jquery-legacy=jquery#1.10 jquery-modern=jquery#2
    

    Or, if you prefer to set that up in a bower.json

    "dependencies": {
        "jquery-legacy": "jquery#1.10",
        "jquery-modern": "jquery#2"
    }
    

提交回复
热议问题