Dojo 1.8 构建系统 - 如何设置前缀/路径



我正在努力使用Dojo 1.8构建系统。我正在尝试使用 dojo/text!templates/SomeView.html 从网址 myapp/tmpl/SomeView.html 获取html:

//FILE: SomeView.js
define(["dojo/_base/declare", "dojo/text!templates/SomeView.html", ...
  function(declare, SomeViewTemplateHTML, ...
  return {...

我似乎无法让它检测"模板"映射到"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"
            ]
        }
    }
};
})();

任何帮助将不胜感激!我已经多次阅读道场/应用程序和道场构建页面,但所有信息真的很有限......

问候眼界

构建过程中没有模板映射,因此如果以下内容是您的结构

myapp/SomeView.js
myapp/tmpl/SomeView.html

那么dojo/text!templates/SomeView.html应该dojo/text!./tmpl/SomeView.html

最新更新