Is JavaScript Web Optimizer working with 3.1x JS API?

4260
3
03-16-2015 04:18 PM
FilipKrál
Occasional Contributor III

Hello,

I am trying to use the JavaScript Web Optimizer (http://jso.arcgis.com​​​) to create some custom builds of ArcGIS JavaScript API. I get the final files but the application does not load and errors out with:

Error 404: .../web-optimizer/dojo/dojo.js.map

Error 404: .../web-optimizer/dojo/cldr/nls/en-gb/gregorian.js

scriptError

I am following the tutorial pretty closely. I tried several builds, the simplest contains the 5 modules below. I tried to apply it on the application that comes in the developer sandbox but I keep getting the errors above.

dijit/_base/manager

dojo/domReady

dojo/fx/Toggler

dojo/_base/html

esri/map

Am I missing anything? What is the latest version when the web optimizer worked for you?

You can see the broken app here: http://filipkral.com/dev/arcgis-js/

I would really appreciate your help here because making a custom build has become necessary to load an app that uses all the attached modules.

Best regards,

Filip.

0 Kudos
3 Replies
FilipKrál
Occasional Contributor III

Aha finally I can see a map!

The first error about gregorian calendar disappeared when I added a config option to specify localization.

<script src="./ags3-13-standard/dojo/dojo.js" data-dojo-config="async: true, locale: 'en-us'"></script>

Note however that the app should really be in en-gb, which did not work.

It still cannot found /dojo/dojo.js.map but so far that has not been a problem (with the vanilla app from developer sandbox).

Still any tips about this topic welcome.

Filip.

LloydHeberlie
Occasional Contributor

Hello Filip,

Are you still having issues with your build?

Lloyd

0 Kudos
FilipKrál
Occasional Contributor III

Hi Lloyd, thanks for coming back to me.

After I set locale to 'en-us' in dojo config my app loads fine. I still get some 404 errors but that doesn't seem to matter.

I still need to keep the dojo config async set to false, but that is probably because I didn't require some third party libraries properly. I suspect this is also the reason why the app loads as slowly as before.

My colleague who is more experienced with grunt, bower, and node.js showed me how to get started with grunt-esri-slurp but I still didn't quite get my head around it. I'd really like to see some video where grunt-esri-slurp and code minification are explained on a complete app.

Best regards,

Filip.

0 Kudos