Dojo配置支持requirejs bundles?dojo配置支持requirejs捆绑
在RequireJS 2.1.10中引入:允许在另一个脚本中配置多个模块ID。例如:
requirejs.config({
bundles: {
'primary': ['main', 'util', 'text', 'text!template.html'],
'secondary': ['text!secondary.html']
}
});
require(['util', 'text'], function(util, text) {
//The script for module ID 'primary' was loaded,
//and that script included the define()'d
//modules for 'util' and 'text'
});
即配置状态:模块 '主', 'util的', '文本' 和 '!文本template.html' 将通过加载模块ID来找到 '主要'。模块'text!secondary.html'可以通过加载模块ID'secondary'找到。
感谢信息,但我想使用dojo的amd加载器。我试图弄清楚的是,如果dojoConfig对象支持requirejs加载器支持的“bundles”属性。 –
@MikeGraham公平地说,我知道dojoConfig没有这样的属性,在文档中没有提及,如果你需要绑定你的dojo应用程序,你应该使用'util'。更多信息在这里https://dojotoolkit.org/reference-guide/1.10/util/和这里:https://dojotoolkitkit.org/reference-guide/1.10/dojo/_base/config.html – GibboK