Search code examples
dojorequirejsamd

Configuring dojo loader paths


I'm having trouble with setting up dojo. Anything defined in the dojo config seems to correctly load using the localhost:8080/Scripts/foo.js path. However if I then try to load a module without this, say:

require(['foo'], function (_foo) { });

Then the client fails the request, with the attempted path being localhost:8080/foo.js. Obviously wrong.

What do I need to change?

// Configuration for the dojo AMD module loader
dojoConfig = {
   baseUrl: "/Scripts",
   packages: [{
      name: 'esri',
      location: 'esri'
   }, {
      name: 'dojo',
      location: 'dojo/dojo'
   }, {
      name: 'dojox',
      location: 'dojo/dojox'
   }, {
      name: 'dijit',
      location: 'dojo/dijit'
   }, {
      name: 'jquery',
      location: '.',
      main: 'jquery-2.0.2'
   },

Thanks.


Solution

  • Either of these will solve your problem:

    1. Set dojoConfig.tlmSiblingOfDojo = false.
    2. Define 'foo' as a package with an explicit location.