我正在努力使用Dojo 1.8构建系统。我正在尝试使用dojo/text!templates/SomeView.html从url myapp/tmpl/SomeView.html中获取html:
//FILE: SomeView.js
define(["dojo/_base/declare", "dojo/text!templates/SomeView.html", ...
function(declare, SomeViewTemplateHTML, ...
return {...我似乎无法让它检测到“template”前缀映射到"myapp/tmpl/“的模块路径。我尝试过路径、loaderConfig.paths、前缀。但是当我运行build.sh --profile app.profile.js时,这些似乎都不起作用:
//FILE: app.profile.js
var profile = (function(){
return {
basePath: ".",
releaseDir: "builds",
releaseName: "foooo",
optimize: "closure",
cssOptimize: "comments",
action: "release",
packages:[{
name: "pkg1",
location: "myapp/pkg1"
}],
loaderConfig: {
paths: {
"templates": "myapp/tmpl"
},
prefixes: {
"templates": "myapp/tmpl"
}
},
prefixes: {
"templates": "myapp/tmpl"
},
layers: {
"dojo/dojo-release": {
include: [ "dojo/dojo", "dojo/domReady"],
customBase: true,
boot: true
},
"foobar/foobar-release": {
include: [
"myapp/app"
]
}
}
};
})();任何帮助都将不胜感激!我已经阅读了很多次dojo/app和dojo构建页面,但所有的信息都非常有限……
致以问候,肯
发布于 2012-12-12 01:04:05
在构建过程中没有模板映射,所以如果下面是您的结构
myapp/SomeView.js
myapp/tmpl/SomeView.html则dojo/text!templates/SomeView.html应为dojo/text!./tmpl/SomeView.html
https://stackoverflow.com/questions/13817611
复制相似问题