A Dojo build profile is a JavaScript file that specifies build parameters.
Procedure
- Click and then click Next. The New JavaScript File wizard opens.
- Select a parent folder from the folders list.
- Type the name of your profile file with the .profile.js extension.
Tip: The builder wizard automatically appends .profile.js to
the name of the profile that you specify in the Dojo Build
Tools wizard. This naming convention is mandatory by the
wizard.
- Click Finish. A
new JavaScript file is
created and opens in the editor.
- Script your builder profile with your layers and prefixes
dependencies. The contents of the file will look like:
dependencies: {
layers: [
// Individual layer objects
]
prefixes: [
// Individual prefix objects
]
}
- dependencies
- (Optional) Contains layer and prefix members.
- layers
- (Optional) Array of layer objects that the
build generates. Layers are built in the order in which they are listed.
By convention the layers member precedes the prefixes member.
- prefixes
- (Optional) Array of prefix objects that describes
the location of the source of a specific top-level module, relative
to the source directory.
Note: If the profile does not contain any dependencies
objects (it is empty), all defaults are applied to the build. The
build creates a single layer file that contains only Dojo Base. All
other resources must be loaded using dojo.require.
Example
Here is an example of the contents of a build profile file:
dependencies = {
stripConsole: "normal",
layers: [
{
name: "../dijit/dijit.js",
dependencies: [
"dijit.dijit"
]
},
{
name: "../dijit/dijit-all.js",
layerDependencies: [
"../dijit/dijit.js"
],
dependencies: [
"dijit.dijit-all"
]
},
{
name: "../dojox/grid/DataGrid.js",
dependencies: [
"dojox.grid.DataGrid"
]
},
{
name: "../dojox/gfx.js",
dependencies: [
"dojox.gfx"
]
},
{
name: "../dojox/charting/widget/Chart2D.js",
dependencies: [
"dojox.charting.widget.Chart2D",
"dojox.charting.widget.Sparkline",
"dojox.charting.widget.Legend"
]
},
{
name: "../dojox/dtl.js",
dependencies: [
"dojox.dtl",
"dojox.dtl.Context",
"dojox.dtl.tag.logic",
"dojox.dtl.tag.loop",
"dojox.dtl.tag.date",
"dojox.dtl.tag.loader",
"dojox.dtl.tag.misc",
"dojox.dtl.ext-dojo.NodeList"
]
}
],
prefixes: [
[ "dijit", "../dijit" ],
[ "dojox", "../dojox" ]
]
}
What to do next
Now, you can
run a custom
Dojo build.