1

I'm struggling with the Dojo 1.8 build system. I'm trying to use dojo/text!templates/SomeView.html to source html from the url myapp/tmpl/SomeView.html:

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

I can't seem to get it to detect the prefix of "templates" mapping to the module path of "myapp/tmpl/". I have tried paths, loaderConfig.paths, prefixes. but none of these seem to do anything when I run the 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"
            ]
        }
    }
};
})();

Any help will be appreciated! I have read the dojo/app and dojo build pages so many times, but all the information is really limited...

Regards, Ken

Kenny
  • 41
  • 1
  • 3

1 Answers1

0

There is no template mapping as part of the build process, so if the following is your structure

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

then dojo/text!templates/SomeView.html should be dojo/text!./tmpl/SomeView.html

Craig Swing
  • 8,152
  • 2
  • 30
  • 43