2

I've got an application build using the ArcGIS JavaScript API. I have several classes built with Dojo define. Each class is in a separate file, and everything is working fine.

However, I've minified my classes (using Visual Studio Web Essentials), and I'd like to tell Dojo to use the minified files. I'm using a dojoConfig like the following:

var dojoConfig = {
  isDebug: false,
  packages: [{
    name: 'js',
    location: '/js'
  }]
};

And dojo loads my files like '/js/MyClass.js'. What do I have to do the get Dojo to load MyClass.min.js ? This would be a successful resolution to my problem.

But, even more, I have gzipped versions of those files, so how can I tell Dojo to download MyClass.min.js.gzip?

I'd even like to take it a step further and bundle all of my classes into one download, say MyBundle.min.js.gzip. That not a problem. But, again, how to explain to the Dojo AMD loader that /js/MyClass1 and /js/MyClass2 are both in MyBundle?

All this, given that I'm not using the Dojo build system.

3

I hate to answer my own question, but I've found a resolution. ESRI is releasing their JavaScript Web Optimizer, which will bundle and optimize everything into one file. That includes custom classes, Dojo itself, and only the required JavaScript API modules. I saw it at the Dev Summit, and it's pretty interesting.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.