How to get bower to use 2 jQuery versions?

时间:2016-10-20 12:45:31

标签: jquery bower

I have the following file:

bower.json

{   
  "name": "genesis",   
  "dependencies": {     
      "codemirror": "^5.18.2",     
      "ember": "^2.8.0",     
      "ember-cli-shims": "^0.1.3",     
      "ember-load-initializers": "^0.5.1",     
      "ember-qunit-builds": "^1.0.0-beta.1",     
      "ember-qunit-notifications": "^0.1.0",     
      "font-awesome": "^4.6.3",     
      "jquery-legacy": "jquery#^2", 
      "jquery-modern": "jquery#^3", 
      "jQuery-contextMenu": "^2.2.4",     
      "lato": "^0.3.0",     
      "lightbox2": "^2.8.2",     
      "loader.js": "^4.0.11",     
      "moment": "^2.14.1",     
      "mozilla-fira": "4.202",     
      "multiselect": "^0.9.12",     
      "qunit": "^2.0.1",     
      "selectize": "^0.12.3",     
      "semantic-ui": "^2.2.4"  
  } 
}

If I would do a bower list on this project I would get to see that all dependencies that depend on jQuery are 3.1.1, making one such package (lightbox2) incompatible.

[folatt@ArkOS_Dev genesis]$ bower list

genesis /home/folatt/workspace/arkos/genesis
├── codemirror#5.20.0
├─┬ ember#2.9.0 (2.10.0-beta.1 available)
│ └── jquery#3.1.1
...
├── jquery-migrate#3.0.0 extraneous
├── lato#0.3.0
├─┬ lightbox2#2.8.2
│ └── jquery#3.1.1 incompatible with ~2 (2.2.4 available, latest is 3.1.1)
...

Removing jquery-modern and bower list shows that all dependencies that depend on jQuery use 2.2.4.

What I would like to see is that all dependencies that depend on jQuery use 3.1.1, except for lightbox2, which should use 2.2.4.

Is that possible and if so, how?

1 个答案:

答案 0 :(得分:0)

通过分叉lightbox2并强制它使用jQuery 3解决了问题。