【发布时间】:2013-06-13 00:06:11
【问题描述】:
我正在使用Kendo UI 版本2013.1.514 和RequireJS(r.js 版本2.1.6)
我的项目在标准 RequireJS 按需加载下完美运行。
但是,当我尝试使用优化器时,不会加载任何剑道。包括它们中的任何一个都会产生著名且令人恼火的Uncaught Error: Mismatched anonymous define() module: 错误。
这是我的配置:
{
"baseUrl": "../Scripts",
"name": "../Scripts/js_modules/base_module.js",
"include": [],
paths: {
k: "Frameworks/kendo-2013.1.514-fixed",
jquery: "Frameworks/jQuery/jquery.min",
jplugin: "Frameworks/jQuery",
f: "Frameworks/"
},
shim: {
'jquery.dataSelector': {
deps: ['jquery'],
exports: 'jquery.dataSelector'
},
},
"exclude": [],
"optimize": "none",
"out": "built-base-modules.js"
}
还有base_module.js
define( function( require ) {
// Don't do anything with them.
// Just define them.
require("jquery");
require("k/kendo.core.min");
//require("k/kendo.userevents.min");
//require("kendoize/kendoize")
});
我不确定这是否相关,但依赖项跟踪似乎也无法正常工作。 (它会成功追踪一层,但不是两层。我曾尝试手动添加core.min 和userevents.min 以查看是否解决了问题。)
有没有人在使用剑道时遇到过这个问题?或者可能是类似的东西?我检查了一堆现有问题,但没有找到与此设置相关的任何内容。
如果需要,我可以发布其他信息,但是详细的 console.log 消息在 require.js 内部的某个地方崩溃了——而不是出现可用的语法错误。
其他信息
页面本身的 HTML/Javascript
<script src="/Business/Scripts/require.js"></script>
<script>
(function () {
"use strict";
var configObject = {
shim: {
'jquery.dataSelector': {
deps: ['jquery'],
exports: 'jquery.dataSelector'
},
},
baseUrl: "http://760.j6.local:80/Business/Scripts",
paths: {
app: "http://760.j6.local:80/Business",
k: "http://760.j6.local:80/Business" + "/Scripts/Frameworks/kendo-2013.1.514",
jquery: "http://760.j6.local:80/Business" + "/Scripts/Frameworks/jQuery/jquery.min",
jplugin: "http://760.j6.local:80/Business" + "/Scripts/Frameworks/jQuery",
f: "http://760.j6.local:80/Business" + "/Scripts/Frameworks/",
}
};
requirejs.config(configObject);
}());
</script>
<script src="/Business/_build/built-base-modules.js"></script>
【问题讨论】:
标签: javascript kendo-ui requirejs