Login Register

Custom build--how to exlude dojo/dijit components from custom namespace build output?

I am attempting to create a custom build of dojo for my organization.

All of our internally developed widgets and utility support functions are in a namespace mojo.

I would like to create a custom build of dojo which creates a dojo.js with the standard dojo components we use, a dijit.js with the standard digits, and a mojo.js (currently called mojoForm.js in my build profile so I can be sure to identify the file correctly in the output) which combines all of our custom widgetry.

I have tried reviewing the Book of Dojo, the sample profiles, and even Dojo: The Definitive Guide by Matthew A. Russel, but I cannot find any detailed and substantive documentation on the build system.

My build is building a nice, compressed mojoForm.js as I would expect, with all of my widgetry in it. However, it also contains all of the digit components called by my widgetry. I would like those to stay in a dijit.js file.

How am I specifying my profile incorrectly? I thought earlier modules were supposed to be excluded from later ones based on the comments in layers.profile.js from the dojo 1 1 1 svn source.

Thanks very any insight.

Here is my build profile:

dependencies = {
        layers: [
                {
                        name: "../dijit/dijit.js",
                        resourceName: 'dijit',
                        dependencies: [
                                "dijit.dijit"
                        ]
                },
               
                {
                        name: "../dijit/dijit-all.js",
                        resourceName: "dijit.discard",
                        layerDependencies: [
                                "../dijit/dijit.js"
                        ],
                        discard:true,
                        dependencies: [
                                "dijit.dijit-all"
                        ]
                },
               
                {
                        name: "../dojox/off/offline.js",
                        layerDependencies: [
                        ],
                        dependencies: [
                //            "dojox.off.offline"
                        ]
                },
               
                {
                        name: "../../mojo/formMojo.js",
                        layerDependencies: ['dijit', 'dijit.discard'],
                        dependencies: [
                                'mojo.util',
                                'mojo.form.prepare'
                        ]       
                }              
        ],

        prefixes: [
                [ "mojo", "m:/mojo-dev/mojo" ],
                [ "dijit", "../dijit" ],
                [ "dojox", "../dojox" ]
        ]
}

For the formMojo.js layer,

For the formMojo.js layer, the layerDependencies should list the layer names and not their resourceName:

{
name: "../../mojo/formMojo.js",
layerDependencies: ['../dijit/dijit.js', '../dijit/dijit-all.js'],
dependencies: [
'mojo.util',
'mojo.form.prepare'
]
}

Remove the resourceName from the dijit.js and dijit-all layers too.

I would also take the discard: true parameter off the dijit-all.js layer, and remove the offline layer, just to make things clearer.

solution

Thank you very much, that worked.

For anyone who searches this topic later, here is the complete working profile for my custom build. I think I know enough now about how the various parameters interact to get it into production shape form my organization.

Thanks again.

dependencies = {
	layers: [
		{
			name: "../dijit/dijit.js",
			//resourceName: 'dijit',
			dependencies: [
				"dijit.dijit"
			]
		},
		
		{
			name: "../dijit/dijit-all.js",
			//resourceName: "dijit.discard",
			layerDependencies: [
				"../dijit/dijit.js"
			],
			//discard:true,
			dependencies: [
				"dijit.dijit-all"
			]
		},
		/*
		{
			name: "../dojox/off/offline.js",
			layerDependencies: [
			],
			dependencies: [
		//		"dojox.off.offline"
			]
		}, */
		
		{
			name: "../../mojo/formMojo.js",
			layerDependencies: ['../dijit/dijit.js', '../dijit/dijit-all.js'],
			dependencies: [
				'mojo.util',
				'mojo.form.prepare'
			]	
		}		
	],

	prefixes: [
		[ "mojo", "m:/mojo-dev/mojo" ],
		[ "dijit", "../dijit" ],
		[ "dojox", "../dojox" ]
	]
}