Select to view content in your preferred language

JavaScript Optimizer (jso.arcgis.com)

1405
4
Jump to solution
05-20-2014 08:11 AM
ScottGunn
Regular Contributor
Hi all,

The JS Optimizer at http://jso.arcgis.com was recently released.  Has anyone had a chance to try it yet?

I compiled a list of modules that my app uses in a plain text file and built it through the system.  Extracted it to my server, included the script tag like so:
<script src="js/dist/dojo/dojo.js" data-dojo-config="async: true"></script>

But it does not load.  The console reports the following on load:
/js/dist/dojo/fx/Toggler.js 404 (Not Found)  on line 26 of dojo.js

The problem is Toggler.js is in my module list on the build (it's a dep) so I'm not sure what's going on...Could it be that I have a custom dojoConfig var defined before loading dojo.js? It has some custom packages, among them the latest version of dgrid.

Very nice tool, looking forward to enjoying the benefits of a compact API on my app.
0 Kudos
1 Solution

Accepted Solutions
derekswingley1
Deactivated User
Thanks. Your dojoConfig looks good, it's not causing this.

We should probably be bundling this module with builds automatically. Until then, please add dojo/fx/Toggler to your module list (it's not in the one you posted).

View solution in original post

0 Kudos
4 Replies
derekswingley1
Deactivated User
Could be related to your dojoConfig. Can you post that as well as your module list that you uploaded?
0 Kudos
ScottGunn
Regular Contributor
Hi Derek,

Sure, here is my dojoconfig (defined before dojo.js is loaded):
<script type="text/javascript" >
 var dojoConfig = {
  async: true,
        packages: [
    { "name": "js",
   "location": location.pathname.replace(/\/[^/]+$/, "")+'js/'
    },
    { "name": "widgets",
   "location": location.pathname.replace(/\/[^/]+$/, "")+'js/widgets/'
    },
    { "name": "dgrid",
   "location": location.pathname.replace(/\/[^/]+$/, "")+'js/dgrid/'
    }
    ]
      };
</script>


I am using AMD so have some custom widgets, etc. in /js and /js/widgets.

Here's my line to load dojo.js (I changed it from myHostname/js/dist to myHostname/dist.  I have also tried to take out the async:true w/ the same results:
<script src="dist/dojo/dojo.js" data-dojo-config="async: true"></script>


Here's my module list (with some duplicates that the JSO appears to remove):
"esri/dijit/PopupTemplate",
"esri/InfoTemplate",
"esri/symbols/SimpleMarkerSymbol", 
"esri/symbols/SimpleLineSymbol",
"esri/symbols/Font",
"dojo/_base/Color",
"esri/map",
"dojo/parser",
"esri/layers/ArcGISDynamicMapServiceLayer",
"esri/layers/ArcGISTiledMapServiceLayer",
"esri/geometry/Extent",
"esri/SpatialReference",
"esri/dijit/Popup",
"dojo/_base/array",
"dojo/dom-construct",
"dojo/dom-class",
"dojo/on",
"esri/tasks/IdentifyTask", 
"esri/tasks/IdentifyParameters", 
"dojo/_base/array", 
"dojo/_base/Deferred", 
"dojo/DeferredList", 
"dojo/_base/declare", 
"dojo/on", 
"esri/tasks/query", 
"dojo/store/Memory", 
"esri/tasks/QueryTask", 
"dojo/_base/array", 
"dojo/domReady!",
"esri/tasks/query", 
"esri/tasks/QueryTask", 
"esri/graphic", 
"esri/symbols/SimpleMarkerSymbol", 
"esri/symbols/SimpleLineSymbol", 
"esri/symbols/SimpleFillSymbol",
"dojo/_base/Color", 
"dojo/domReady!",
"dijit/form/HorizontalSlider", 
"dojo/domReady!",
"esri/tasks/query",
"esri/tasks/QueryTask",
"dojo/_base/array", 
"esri/dijit/BasemapGallery",
"esri/geometry/Extent",
"esri/toolbars/draw",
"esri/symbols/SimpleMarkerSymbol", 
"esri/symbols/SimpleLineSymbol",
"esri/symbols/SimpleFillSymbol", 
"esri/symbols/CartographicLineSymbol", 
"esri/graphic", 
"esri/Color", 
"dojo/dom", 
"dojo/on",
"esri/geometry/Point",
"esri/geometry/webMercatorUtils",
"esri/SpatialReference",
"esri/graphic",
"dojo/on",
"dojo/on", 
"esri/tasks/GeometryService",
"esri/layers/GraphicsLayer",
"esri/geometry/Point",
"esri/geometry/Polyline",
"esri/symbols/TextSymbol",
"esri/tasks/DistanceParameters",
"esri/tasks/AreasAndLengthsParameters",
"esri/graphic",
"dojo/_base/array",
"esri/toolbars/navigation",
"esri/tasks/Geoprocessor",
"esri/request",
"esri/tasks/DataFile",
"esri/layers/ArcGISDynamicMapServiceLayer",
"dojo/dom",
"dojo/_base/array",
"dojox/data/CsvStore",
"esri/geometry/webMercatorUtils",
"esri/geometry/Point",
"esri/geometry/Multipoint",
"esri/layers/FeatureLayer",
"dojo/on",
"dojo/_base/lang",
"esri/tasks/PrintTask", 
"esri/tasks/PrintParameters", 
"esri/tasks/PrintTemplate", 
"esri/dijit/Scalebar"


Thanks!
0 Kudos
derekswingley1
Deactivated User
Thanks. Your dojoConfig looks good, it's not causing this.

We should probably be bundling this module with builds automatically. Until then, please add dojo/fx/Toggler to your module list (it's not in the one you posted).
0 Kudos
ScottGunn
Regular Contributor
Thanks. Your dojoConfig looks good, it's not causing this.

We should probably be bundling this module with builds automatically. Until then, please add dojo/fx/Toggler to your module list (it's not in the one you posted).


Thanks, that did the trick!
0 Kudos