【发布时间】:2014-02-28 19:00:10
【问题描述】:
我是 Yeoman 的新手,我正在使用官方 Backbone 生成器设置一个新项目。我已经使用以下命令添加了 jQuery Mobile:
bower install -save jquery-mobile
当我运行应用程序时,require.js 报告我所有的 jquery-mobile 脚本都丢失了。我已经阅读了关于 here 和 here 的帖子。我一定是少了一个步骤,或者我的 main.js 设置错误。
这是我的 main.js 的相关部分:
require.config({
shim: {
<...>
jquerymobileconfig: {
deps: [
'jquery'
]
},
jquerymobile: {
deps: [
'jquery',
'jquerymobileconfig'
]
}
},
paths: {
jquery: '../bower_components/jquery/jquery',
jquerymobileconfig: 'jqmconfig',
jquerymobile: '../bower_components/jquery-mobile/js/jquery.mobile',
backbone: '../bower_components/backbone/backbone',
underscore: '../bower_components/underscore/underscore'
}
});
require([
'jquery', 'backbone', 'jquerymobile'
], function ($, Backbone) {
Backbone.history.start();
});
【问题讨论】:
标签: jquery-mobile backbone.js requirejs yeoman