Dojo build layers provide a clean path from development to production when using Dojo for your UI layer. In development, you can have load-on-demand, rapid application prototyping; a build layer takes all Dojo dependencies and compiles them to a single file, optionally stripping whitespace and comments, and performing code heuristics to allow further minification of variable names. Additionally, it can do CSS minification.
dojo.provide("custom.main"); dojo.require("dijit.layout.TabContainer"); dojo.require("dijit.layout.ContentPane"); dojo.require("dijit.form.Form"); dojo.require("dijit.form.Button"); dojo.require("dijit.form.TextBox");
This script is generally referred to as a "layer" script.
Then, in your application's layout, you'd instruct Dojo to load this module:
If you use
Zend_Dojo to do this, you'd do the
Zend_Dojo aggregates your various
dojo.require statements, how do you create your layer
script? You could open each page and view the generated
dojo.require statements, and cut and paste them into a
layer script file manually.
However, a better solution exists: since
Zend_Dojo aggregates this information
already, you can simply pull that information and build your layer
file. This is the purpose of