我在Dojo构建中有很多依赖项,即使在构建之后,它仍然由HTTP请求加载。我有我的应用程序的特定依赖项:
"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"
但即使知道所有这些依赖项,我似乎也无法获得实际包含所需的每个依赖项的构建。例如,这是chrome调试器的片段:
如何将所有内容编译成一个js文件?或者它不是那样的工作?我对dojo的工作要求非常困惑。它还试图在中提取所有css文件。有没有办法将这些css文件编译成某些东西,以便我没有30个包含css文件?
如果您需要更多信息,请与我们联系。我正在使用Dojango来管理dojo交互,如果它改变了什么,但构建过程是相同的,所以我很确定它没有。我的完整构建配置文件只是dojango的扩展,在此处列出:
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" ]
]
};
我的构建命令基本上如下,虽然它是由dojango完成的:
./build.sh dojango_optimized.profile.js action=release optimize=shrinksafe cssOptimize=comments