The dojoConfig packages

Using the built-in Dojo packages is great and all, but what about making your own custom package? You can create custom packages in your local folders, and reference them through your dojoConfig object. In the dojoConfig object, you can add a packages parameter that contains an array of JavaScript objects. Those package objects should contain a name attribute, which is a reference to your package, and a location attribute, which references the folder location. Here's an example of a dojoConfig object with a reference to a custom package:

<script>
  dojoConfig = {
    async: true,
    isDebug: true,
    packages: [
      {
        name: "myapp",
        location: location.pathname.replace(/\/[^/]+$/, '') + "/myapp"
      }
    ]
  };
</script>

In the preceding sample, ...

Get Mastering ArcGIS Server Development with JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.