Dojo Custom Build 1.6成为一个文件 [英] Dojo Custom Build 1.6 into a single file
问题描述
我想要有一个单个js文件加载我在应用程序中使用的所有组件。所以它不会加载几个文件只有一个包含我需要的,或至少只是我需要的。
据我所知,我需要为此构建创建一个配置文件,这是我使用的配置文件(在配置文件文件夹中的文件ex:test.profiles.js)。
依赖关系= {
layers:[
{
名称:test_dojo.js,
customBase:true,
selectorEngine:acme,
依赖关系:[
dojo / dojo,
dijit。 form.Form,
dijit.form.Button,
dijit.form.Textarea,
dojo.parser,
dijit.form.MultiSelect ,
dijit.layout.ContentPane,
dijit.layout.BorderContainer,
dijit.Toolbar,
dijit.form.TextBox,
dijit.form.SimpleTextarea,
dijit.form.ComboBox,
dojo.date,
dojo.date.locale,
dijit。 form.DateTextBox,
dijit.layout.TabContainer,
dojo.data.ItemFileReadStore,
'dijit.Dialog',
dojox.grid.DataGrid ,
dijit.form.DropDownButton,
dijit.form.CheckBox,
dijit.form.FilteringSelect,
dijit.form.NumberTextBox,
dijit .Tree,
dojox.charting.Chart2D,
dojox.charting.widget.Legend,
dojox.charting.action2d.Tooltip,
dojox .charting.action2d.Magnify,
dojox.charting.themes.PlotKit.green,
dojox.charting.themes.PlotKit.red,
dojox.charting.themes .plotKit.blue,
dojox.widget.Standby,
dojox.form.Uploader,
dojox.form.uploader.plugins.IFrame,
dojox.form.uploader.FileList,
dijit.ProgressBar,
dojox.embed.Flash,
dijit.Tooltip,
dojox.cometd ,
dijit._base.scroll
]
}
],
前缀:[
[ dijit,../dijit],
[dojox,../dojox]
]
};
我以这种方式运行:
> build.bat profile = test action = release
如果我发现dojo - > dojo,dijit,dojox文件夹和dojo - > test_dojo里面,这将产生一个文件夹release。 js
我将该版本的内容复制到应用程序中,并替换html文件中的脚本标签。
< script src =/ dojo_release / dojo / test_dojo.jstype =text / javascript
djconfig =usePlainJson:true,parseOnLoad:true>< / script>
但是得到错误:dojo没有在第14行中定义
,如果我尝试加载dojo然后这个文件:
< script src =/ dojo_release / dojo / dojo.jstype =text / javascript
djconfig =usePlainJson:true,parseOnLoad:true>< / script>
< script src =/ dojo_release / dojo / psirt_dojo.jstype =text / javascript>< / script>
我调试应用程序,并得到它正在尝试加载几个文件(如以前),并获得错误,如无法加载dijit.form.Form';最后尝试'../dijit/form/Form.js'
这可能是一个基本问题im安静的新的dojo和更多与定制的东西。
我有正确的个人资料或这里可能是什么问题,我做错了什么。
感谢您的建议。
您不需要'customBase'标志来执行此操作。您可以使用自己的当前内容_plus替换一些您自己的缓存模块的dojo.js文件。
依赖关系= {
selectorEngine:acme,
layers:[
{
name:../dojo/dojo.js,
依赖关系:[
..
]
}
}
I've a problem trying to create a custom build on Dojo, I dont even know is it possible what i want..
I want to have a "single js file" loading all the components that i use across the application. so it doesnt load several files just one containing what I need, or at least just the ones I need.
As far as I read I need to create a Profile for this build, this is the profile I use (file in profiles folder ex: test.profiles.js).
dependencies ={
layers: [
{
name: "test_dojo.js",
customBase: true,
selectorEngine: "acme",
dependencies: [
"dojo/dojo",
"dijit.form.Form",
"dijit.form.Button",
"dijit.form.Textarea",
"dojo.parser",
"dijit.form.MultiSelect",
"dijit.layout.ContentPane",
"dijit.layout.BorderContainer",
"dijit.Toolbar",
"dijit.form.TextBox",
"dijit.form.SimpleTextarea",
"dijit.form.ComboBox",
"dojo.date",
"dojo.date.locale",
"dijit.form.DateTextBox",
"dijit.layout.TabContainer",
"dojo.data.ItemFileReadStore",
'dijit.Dialog',
"dojox.grid.DataGrid",
"dijit.form.DropDownButton",
"dijit.form.CheckBox",
"dijit.form.FilteringSelect",
"dijit.form.NumberTextBox",
"dijit.Tree",
"dojox.charting.Chart2D",
"dojox.charting.widget.Legend",
"dojox.charting.action2d.Tooltip",
"dojox.charting.action2d.Magnify",
"dojox.charting.themes.PlotKit.green",
"dojox.charting.themes.PlotKit.red",
"dojox.charting.themes.PlotKit.blue",
"dojox.widget.Standby",
"dojox.form.Uploader",
"dojox.form.uploader.plugins.IFrame",
"dojox.form.uploader.FileList",
"dijit.ProgressBar",
"dojox.embed.Flash",
"dijit.Tooltip",
"dojox.cometd",
"dijit._base.scroll"
]
}
],
prefixes: [
[ "dijit", "../dijit" ],
[ "dojox", "../dojox" ]
]
};
I ran it this way: > build.bat profile=test action=release
this generates me the folder "release" inside if this I find dojo -> dojo, dijit, dojox folder and inside dojo -> test_dojo.js
I copy the content of the release into the application and replace the script tag in the html files.
<script src="/dojo_release/dojo/test_dojo.js" type="text/javascript"
djconfig="usePlainJson: true,parseOnLoad: true"></script>
but get the error: "dojo is not defined in line 14"
and if I try to load the dojo and then this file:
<script src="/dojo_release/dojo/dojo.js" type="text/javascript"
djconfig="usePlainJson: true,parseOnLoad: true"></script>
<script src="/dojo_release/dojo/psirt_dojo.js" type="text/javascript"></script>
I debug the application and get that is trying to load several files (as it used to) and get errors such as "Could not load 'dijit.form.Form'; last tried '../dijit/form/Form.js'"
this maybe a basic question im quiet new with dojo and more with the custom build stuff.
Do I have correct the profile or what could be the problem here, what am I doing wrong.
Thanks in advice.
You do not need the 'customBase' flag to do this. You can simply override the dojo.js file with its current contents _plus some cached modules of your own.
dependencies ={
selectorEngine: "acme",
layers: [
{
name: "../dojo/dojo.js",
dependencies: [
...
]
}
}
这篇关于Dojo Custom Build 1.6成为一个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!