这就是我在main.js
中所做的:
requirejs.config({
enforceDefine: true,
paths: {
"jquery": "libs/jquery/jquery-min",
"underscore": "libs/underscore/underscore-min",
"backbone": "libs/backbone/backbone-min",
"reveal":"libs/jquery/jquery.reveal"
},
shim: {
"underscore": {
deps: [],
exports: "_"
},
"backbone": {
deps: ["jquery", "underscore"],
exports: "Backbone"
},
"reveal": {
exports: "Reveal"
}
}
});
未捕获错误:没有定义显示调用 http://requirejs.org/docs/errors.html#nodefine
知道可能导致这种情况的原因。感谢。
答案 0 :(得分:2)
查看enforceDefine
property的API。您的reveal
填充程序未将jQuery指定为依赖项,并且额外属性还要求您正确导出它:
"reveal": {
deps: ["jquery"],
exports: "jQuery.fn.reveal"
}