Question

I have created own build profile following the instructions from http://www.sitepen.com/blog/2012/06/11/dgrid-and-dojo-nano-build/. I've created bootstrap layer for dojo:

    'dojo/dojo': {         
        include: ['dojo/dojo', 'dojo/domReady', 'dojo/_base/declare'],         
        boot: true,         
        customBase: true    
    },

I've noticed also, that if I skip definition of this layer, the bigger dojo package is created, so the modules included in the second layer are duplicated.

The second layer contains GridX modules, dijit controls and everything else from Dojo that is used:

    'dojo/dojo-all': {
        include: ["dojo/on", "dojo/dom-attr", "dojo/dom-class", "dojo/query", "dojo/_base/lang", "dojo/request/xhr", "dojo/parser", "dojo/_base/connect", "dojo/DeferredList", "dojo/store/Memory", "dojo/store/Observable",
        "dijit/registry","dijit/form/TextBox", "dijit/form/Textarea", "dijit/form/ComboBox", "dijit/form/FilteringSelect", "dijit/form/CheckBox", "dijit/form/Button",
        "gridx/core/model/cache/Sync", "gridx/Grid", "gridx/modules/SingleSort", "gridx/modules/ColumnResizer", "gridx/modules/Pagination", "gridx/modules/pagination/PaginationBar", "gridx/modules/CellWidget", "gridx/modules/Edit", "gridx/modules/Persist", "gridx/modules/Filter", "gridx/modules/filter/FilterBar", "gridx/modules/filter/QuickFilter", "gridx/modules/HiddenColumns"],
        exclude: ['dojo/dojo', 'dojo/domReady', 'dojo/_base/declare'],
        boot: true,
        customBase: false
    },

The application starts correctly, and it makes only a request to layered resources, however there is an error in FireBug console:

Error: defineAlreadyDefined makeError() dojo-all.js (Zeile 28)

I think this is because the declare module is loaded twice: first with dojo.js bootstrap, defined from HTML file. Second, from dojo-all.js layer, loaded dynamically via require.

There must be some flow in my approach based on cited article, or the article is adapted to the older version of Dojo (I'm using version 1.9).

What is the error here? How should the layers be correctly defined? How can I instruct dojo build not to overwrite the dojo.js bootstrap? Or the exclude is not correctly declared - if so, how should it be declared?

Was it helpful?

Solution

Setting boot: true causes the loader to be included. Only set boot: true on the layer that you want to include the define function.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top