0

I have a problem with my build in Dojo. It does build, and most of all widgets seems to be included in dojo.js after the build. But when I test the built project it still loads about 100 files on demand. I think the common denominator for the files that doesn't get build, is that they don't use return declare( But instead returns functions or objects.

I attach a print-screen of some of the modules that doesn't get bundled in the build. Dump from Firebug NET-console

The question is, is there some way of bundling these files into dojo.js, and avoid the 100+ extra requests?

johan
  • 3
  • 3
  • add some more details.. like hw u r loading dojo.. cdn or offline? – Vikash Pandey Jan 12 '16 at 09:13
  • What does your build profile look like? What does your application actually load? Are you actually configuring a layer based on your app (which is what causes files to be concatenated)? – Ken Franqueiro Jan 13 '16 at 03:37

1 Answers1

0

Dojo builds are a pain in my neck. There are several different ways to configure them.

Generally, if you're trying to build everything (including Dojo) into one Javascript source file make sure your layer has "customBase" and "boot" set to "true".

build.profile.js

var profile = (function() {
    return {
        layers: {
            "my/layer": {
                customBase: true,
                boot: true
            }
        }
    }
}();

That should catch all of the Dojo source files. Otherwise, if something somehow slips that's what the "include" option is for. It's an explicit list of modules that get built into the layer.

build.profile.js

var profile = (function() {
    return {
        layers: {
            "my/layer": {
                include: [ "dojo/dojo", "dojo/date", ... ]
            }
        }
    }
}();
user2867288
  • 1,979
  • 16
  • 20