Bower:安装2个版本的jQuery [英] Bower: Install 2 versions of jQuery

查看:150
本文介绍了Bower:安装2个版本的jQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将如何使用Bower安装2个版本的jQuery??我想同时拥有v2.0和1.9.1,以支持浏览器回退

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

我遇到的问题是,如果您运行 bower安装jquery#1.9.1 jquery#2.0.0 第一个版本被第二个版本覆盖,因为它们是相同的组件

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

推荐答案

在bower.json的依赖项部分,您可以像这样:

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"
}

通常不需要这样做,但有时您必须维护/迁移(无论出于何种原因)在不同页面中使用不同版本的jquery的现有网站!

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!

这篇关于Bower:安装2个版本的jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆