Reputation: 3247
I have a sample script which uses
dojo.require("dojo.parser");
dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.TabContainer");
dojo.require("dojox.grid.DataGrid");
dojo.require("dijit.Tree");
dojo.require("dojo.data.ItemFileReadStore");
I want to create a minified build of dojo, so I use this profile
dependencies = {
stripConsole : "normal",
selectorEngine : "acme",
optimize : "closure",
layerOptimize : "closure",
cssOptimize : "comments.keepLines",
mini : true,
internStrings : true,
localeList : "en-us",
releaseName : "dojo.custom",
action : "release",
optimize : "shrinksafe",
layerOptimize : "shrinksafe",
layers : [
{
name : "dojo.js",
dependencies : [
"dojo.parser",
"dojo.data.ItemFileReadStore",
"dojox.grid.DataGrid",
"dijit.layout.BorderContainer",
"dijit.layout.ContentPane",
"dijit.layout.TabContainer",
"dijit.Tree"
]
}
],
prefixes: [ [ "dijit", "../dijit" ], [ "dojox", "../dojox" ] ]
}
Yes, builder compile huge dojo.js file which I include in my html page, but still there is MANY xhr requests. System loads scripts which I don't use explicitly. Here's a screenshot
Upvotes: 2
Views: 2056
Reputation: 8550
Interesting.
Are you sure the browser is successfully finding and loading the compressed version?
The browser is looking for _base.js which should definitely already be baked into that file.
Update
Tommi - dojo.js layer is always built by the build system, you don't have to explicitly declare it. I'm not sure what the effect will be of you explicitly declaring it along with dependencies. This might work, but it might not. Maybe the dependencies are overridding the normal dojo.js contents.
What I normally do is just let the system build dojo.js and then create a layer that has all the dijit/dojox stuff that I may want, and deploy that. I also usually create a 3rd separate file with my custom stuff in it.
I would try that. The key I think is to make a separate layer from dojo.js. (But still include the normal dojo.js in your page).
Upvotes: 2