1

This what I did in 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"
    }

}
});

Uncaught Error: No define call for reveal http://requirejs.org/docs/errors.html#nodefine

Any idea what could be causing this. Thanks.

4

1 回答 1

2

查看enforceDefine属性的 API 。您的revealshim 没有将 jQuery 指定为依赖项,并且额外的属性还要求您正确导出它:

"reveal": {
    deps: ["jquery"],
    exports: "jQuery.fn.reveal"
}
于 2013-09-27T06:57:11.630 回答