2

I am working on my first project which uses a dojo 1.7.2 component, and only need a vertical slider widget. I was able to create a custom build which is supposed to include only the modules needed for my stated dependencies. Using the following build profile, and the command C:\dojo-release-1.7.2-src\util\buildscripts>build -p profiles/km.admin.dashboard.profile.js -r the resulting release/dojo/dojo.js.uncompressed.js is 796kb, and the release/dojo/dojo.js is 236kb. Is there any way to exclude more unneeded modules to reduce the file size? For instance, I just opened the release/dojo/dojo.js.uncompressed.js and took a quick look, there is a dojo/json package, I am not using any json. How do I exclude it? Thank you.

dependencies = {
layers: [
{
    name: 'dojo.js',
    customBase: true,
    dependencies: [
        'dojo/dojo',
        'dojo.aspect',
        'dojo/selector/acme',
        'dojo/cldr/nls/number',
        'dijit.form.VerticalSlider',
        'dijit.form.VerticalRule',
        'dijit.form.VerticalRuleLabels'
    ]
}
],

staticHasFeatures: {
    'dojo-trace-api':0,
    'dojo-log-api':0,
    'dojo-publish-privates':0,
    'dojo-sync-loader':0,
    'dojo-xhr-factory':0,
    'dojo-test-sniff':0
},

prefixes: [
    [ 'dijit', '../dijit' ],
    [ 'dojox', '../dojox' ]
]
}
Danubian Sailor
  • 1
  • 38
  • 145
  • 223
Rick Suggs
  • 1,582
  • 1
  • 15
  • 30
  • unrelated to the size issue, but in 1.7+ you should use selectorEngine for acme, slashes for module paths. Intermediate dependencies like dojo/cldr/nls/number should not be necessary. – peller Apr 11 '12 at 16:20

1 Answers1

0

There are some approaches by which you can trim down dojo.js to a bare minimum and keep adding the modules within dojo.js that you really need.

See:

http://dojotoolkit.org/reference-guide/1.7/build/customBase.html

and also: http://www.sitepen.com/blog/2008/07/01/dojo-in-6k/ (this is somewhat old and cutombase approach in the first link might work better)

Vijay Agrawal
  • 3,751
  • 2
  • 23
  • 25