我有一个应用程序,用 Backbone 编写,带有 Marionette 和其他一些依赖项,通过bower管理:
{
"name": "admin",
"version": "0.1.1",
"main": "public/javascripts/app.js",
"dependencies": {
"lodash": "~2.4.1",
"console-polyfill": "~0.1.0",
"jquery": "~2.1.1",
"normalize-css": "~2.1.2",
"marionette": "~1.7.4",
"bootstrap": "~3.1.1",
"font-awesome": "~4.1.0",
"backbone-pageable": "~1.4.5",
"moment": "~2.5.1",
"swag": "~0.6.1",
"jquery-form": "~3.46.0",
"jquery-file-upload": "~9.5.7",
"underscore.string": "~2.3.3",
"bootstrap-switch": "~3.0.1",
"joint": "~0.9.0"
},
"overrides": {
"backbone": {
"dependencies": {
"lodash": "*",
"jquery": "*"
},
"main": "backbone.js"
},
"backbone.wreqr": {
"dependencies": {
"backbone": "*"
},
"main": "lib/amd/backbone.wreqr.js"
},
"backbone-pageable": {
"dependencies": {
"backbone": "*"
},
"main": "lib/backbone-pageable.js"
},
"jquery-file-upload": {
"dependencies": {
"jquery": "*"
},
"main": [
"js/vendor/jquery.ui.widget.js",
"js/jquery.iframe-transport.js",
"js/jquery.fileupload.js"
]
},
"underscore.string": {
"dependencies": {
"lodash": "*"
},
"main": "lib/underscore.string.js"
},
"joint": {
"dependencies": {
"lodash": "*"
},
"main": "dist/joint.clean.js"
}
},
"resolutions": {
"jquery": "~2.1.1"
}
}
我想添加Joint.js ( http://www.jointjs.com/ ),它依赖于lodash (下划线的替代品),但我不知道如何在我的配置中替换它,因为 Marionette, Backbone ,而其他一些库直接依赖于下划线。所以在负载下划线覆盖lodash,应用程序无法正确启动。