2

I have a ton of dependencies in a Dojo build that, even after being built, are still loaded by the HTTP request. I have the specific dependencies for my app:

"dijit/_base",
"dijit.form.TimeTextBox",
"dijit/Dialog",
"dijit/DropDownMenu",
"dijit/focus",
"dijit/form/Button",
"dijit/form/CheckBox",
"dijit/form/ComboBox",
"dijit/form/ComboButton",
"dijit/form/DropDownButton",
"dijit/form/FilteringSelect",
"dijit/form/MultiSelect",
"dijit/form/NumberSpinner",
"dijit/form/Select",
"dijit/form/SimpleTextarea",
"dijit/form/TextBox",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dijit/layout/LayoutContainer",
"dijit/Menu",
"dijit/MenuItem",
"dijit/ProgressBar",
"dijit/registry",
"dijit/Widget",

"dojango.dojango",

"dojo.data.ItemFileReadStore",
"dojo.date.locale",
"dojo.dnd.Source",
"dojo.parser",

"dojo/_base",
"dojo/_base/array",
"dojo/_base/declare",
"dojo/_base/Deferred",
"dojo/_base/event",
"dojo/_base/kernel",
"dojo/_base/window",
"dojo/_base/xhr",
"dojo/data/ObjectStore",
"dojo/dom",
"dojo/dom-construct",
"dojo/dom-style",
"dojo/domReady",
"dojo/html",
"dojo/json",
"dojo/keys",
"dojo/mouse",
"dojo/node",
"dojo/NodeList-manipulate",
"dojo/on",
"dojo/parser",
"dojo/query",
"dojo/ready",
"dojo/request",
"dojo/request/node",
"dojo/request/registry",
"dojo/store/JsonRest",
"dojo/store/Memory",
"dojo/store/Observable",
"dojo/store/util/QueryResults",
"dojo/when",
"dojo/window",

"dojox.data.QueryReadStore",
"dojox/charting/action2d/Magnify",
"dojox/charting/action2d/MoveSlice",
"dojox/charting/action2d/Tooltip",
"dojox/charting/axis2d/Default",
"dojox/charting/Chart",
"dojox/charting/Chart2D",
"dojox/charting/DataChart",
"dojox/charting/plot2d/Grid",
"dojox/charting/plot2d/Lines",
"dojox/charting/plot2d/Markers",
"dojox/charting/plot2d/Pie",
"dojox/charting/StoreSeries",
"dojox/charting/themes/Claro",
"dojox/charting/widget/Chart2D",
"dojox/charting/widget/Legend",
"dojox/data/JsonRestStore",
"dojox/form/Uploader",
"dojox/gfx/utils",
"dojox/grid/DataGrid",
"dojox/lang/functional/object",
"gridx/core/model/cache/Async",
"gridx/Grid",
"gridx/modules/ColumnResizer",
"gridx/modules/extendedSelect/Cell",
"gridx/modules/extendedSelect/Row",
"gridx/modules/Filter",
"gridx/modules/filter/FilterBar",
"gridx/modules/HeaderMenu",
"gridx/modules/NestedSort",
"gridx/modules/Pagination",
"gridx/modules/pagination/PaginationBar",
"gridx/modules/select/Row",
"gridx/modules/SingleSort",
"gridx/modules/VirtualVScroller",
"gridx/support/exporter/toCSV"

But even knowing all of these dependencies, I can't seem to get a build that actually includes every dependency that I need. For example, this is a snippet of the chrome debugger : Chrome web debugger

How do I get everything compiled into one js file? Or does it not work like that? I'm pretty confused about how the requirements for dojo work. It also still tries to pull all the css files in css includes. Is there any way to compile these css files into something so that I don't have 30 includes of css files?

Let me know if you need more information. I'm using Dojango to manage the dojo interaction if that changes anything, but the build process is the same so I'm pretty sure it doesn't. My full build profile is just an extension of dojango's, listed here:

dependencies = {
    layers: [
        {
            name: "dojo.js",
            layerDependencies: [
                "../dijit/dijit.js"
            ],
            dependencies: [

                "chosen/Chosen",

                "dijit.dijit-all",
                "dijit/_base",
                "dijit.form.TimeTextBox",
                "dijit/Dialog",
                "dijit/DropDownMenu",
                "dijit/focus",
                "dijit/form/Button",
                "dijit/form/CheckBox",
                "dijit/form/ComboBox",
                "dijit/form/ComboButton",
                "dijit/form/DropDownButton",
                "dijit/form/FilteringSelect",
                "dijit/form/MultiSelect",
                "dijit/form/NumberSpinner",
                "dijit/form/Select",
                "dijit/form/SimpleTextarea",
                "dijit/form/TextBox",
                "dijit/layout/BorderContainer",
                "dijit/layout/ContentPane",
                "dijit/layout/LayoutContainer",
                "dijit/Menu",
                "dijit/MenuItem",
                "dijit/ProgressBar",
                "dijit/registry",
                "dijit/Widget",

                "dojango.dojango",

                "dojo.data.ItemFileReadStore",
                "dojo.date.locale",
                "dojo.dnd.Source",
                "dojo.parser",

                "dojo/_base",
                "dojo/_base/array",
                "dojo/_base/declare",
                "dojo/_base/Deferred",
                "dojo/_base/event",
                "dojo/_base/kernel",
                "dojo/_base/window",
                "dojo/_base/xhr",
                "dojo/data/ObjectStore",
                "dojo/dom",
                "dojo/dom-construct",
                "dojo/dom-style",
                "dojo/domReady",
                "dojo/html",
                "dojo/json",
                "dojo/keys",
                "dojo/mouse",
                "dojo/node",
                "dojo/NodeList-manipulate",
                "dojo/on",
                "dojo/parser",
                "dojo/query",
                "dojo/ready",
                "dojo/request",
                "dojo/request/node",
                "dojo/request/registry",
                "dojo/store/JsonRest",
                "dojo/store/Memory",
                "dojo/store/Observable",
                "dojo/store/util/QueryResults",
                "dojo/when",
                "dojo/window",

                "dojox.data.QueryReadStore",
                "dojox/charting/action2d/Magnify",
                "dojox/charting/action2d/MoveSlice",
                "dojox/charting/action2d/Tooltip",
                "dojox/charting/axis2d/Default",
                "dojox/charting/Chart",
                "dojox/charting/Chart2D",
                "dojox/charting/DataChart",
                "dojox/charting/plot2d/Grid",
                "dojox/charting/plot2d/Lines",
                "dojox/charting/plot2d/Markers",
                "dojox/charting/plot2d/Pie",
                "dojox/charting/StoreSeries",
                "dojox/charting/themes/Claro",
                "dojox/charting/widget/Chart2D",
                "dojox/charting/widget/Legend",
                "dojox/data/JsonRestStore",
                "dojox/form/Uploader",
                "dojox/gfx/utils",
                "dojox/grid/DataGrid",
                "dojox/lang/functional/object",
                "gridx/core/model/cache/Async",
                "gridx/Grid",
                "gridx/modules/ColumnResizer",
                "gridx/modules/extendedSelect/Cell",
                "gridx/modules/extendedSelect/Row",
                "gridx/modules/Filter",
                "gridx/modules/filter/FilterBar",
                "gridx/modules/HeaderMenu",
                "gridx/modules/NestedSort",
                "gridx/modules/Pagination",
                "gridx/modules/pagination/PaginationBar",
                "gridx/modules/select/Row",
                "gridx/modules/SingleSort",
                "gridx/modules/VirtualVScroller",
                "gridx/support/exporter/toCSV",
            ]
        }
    ],

    prefixes: [
        [ "dijit", "../dijit" ],
        [ "dojox", "../dojox" ],
        [ "dojango", "../../../dojango" ], // relative to the directory, where the dojo.js source file resides
        [ "gridx", "../../../gridx" ],
        [ "app", "../../../app" ],
        [ "chosen", "../../../chosen" ]
    ]
};

My build command is basically the following, although it's done by dojango:

 ./build.sh dojango_optimized.profile.js action=release optimize=shrinksafe cssOptimize=comments
cwill747
  • 536
  • 4
  • 11
  • Can you post your build profile and the command that you're using to build? – Richard Ayotte Dec 30 '13 at 15:14
  • Edited to include both. Thanks for the attention :) – cwill747 Dec 30 '13 at 22:31
  • In response to this question: "How do I get everything compiled into one js file?", I came across this [post on dojo forums](http://dojo-toolkit.33424.n3.nabble.com/Building-dojo-generate-multiple-files-tp4000527p4000528.html) with a response from Dylan. If you haven't seen it, worth taking a look. Dylan states: *"Dojo's build system doesn't attempt to remove every file outside your layer, it just creates optimized layer files. It still retains a full copy of the source tree, in case you have other files (JS, CSS, image files, etc.) that are not part of your layer."* – medokr Jan 03 '14 at 20:59
  • Yeah, I understand that, the problem is that my layer _should_ contains every thing that I need. I would understand if it was loading things outside what I've declared in the build file (that's fine), but it's loading files that I even have declared in the layer (for example, window.js above) – cwill747 Jan 05 '14 at 03:37

0 Answers0