Creating a Dojo profiled build (custom build)

A Dojo build profile is a JavaScript file that specifies build parameters.

Procedure

  1. Click File > New > Other > JavaScript > JavaScript Source File and then click Next. The New JavaScript File wizard opens.
  2. Select a parent folder from the folders list.
  3. 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.
  4. Click Finish. A new JavaScript file is created and opens in the editor.
  5. 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.
Icon that indicates the type of topic Task topic
Timestamp icon Last updated: July 17, 2017 21:58

File name: tdojoprofile.html