How to include gridx and every dependency in a dojo build

627 views Asked by At

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
0

There are 0 answers