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

查看:21
本文介绍了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 install 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天全站免登陆