【问题标题】:Making a custom build in dojo 1.7.2在 dojo 1.7.2 中进行自定义构建
【发布时间】:2012-04-24 04:40:37
【问题描述】:

我的 Dojo 1.7.2 自定义构建需要一些帮助 - 构建工作正常,但在浏览器中返回错误。

这是我的个人资料文件:

dependencies = {
    layers: [
            {
                    // This is a specially named layer, literally 'dojo.js'
                    // adding dependencies to this layer will include the modules
                    // in addition to the standard dojo.js base APIs.
                    name: "dojo.js",
                    dependencies: [
                            "dijit.registry",
                            "dijit.Dialog",
                            "dijit.Tooltip",
                            "dijit.form.Button",
                            "dijit.layout.ContentPane"
                    ]
            }
    ],

    prefixes: [
            [ "dijit", "../dijit" ],
            [ "dojox", "../dojox" ]
    ]

}

我认为我不需要添加“digit.registry”——无论有没有它,生成的 dojo.js 文件都不会改变。因为我使用了 digit.byId

,所以我把它变成了一个依赖项

这是我的构建方式:

./build.sh -r --profile profiles/my.profile.js --releaseDir /my/release/directory

然后我将生成的 dojo.js 包含在我的 html 代码中。当页面加载时,javascript 控制台在尝试使用 digit.byId 执行某些操作时显示错误“_5c4 不是函数”。

当我从 ajax.googleapis.com 加载完整的 Dojo 时,一切正常。

我也应该在 html 中包含 ../dijit/dijit.js 吗?

【问题讨论】:

  • dijit/dijit 有时会构建为单独的层,但这不是必需的。按照您的配置方式,所有中间 dijit 依赖项(dijit/_base/*、dijit/_Widget 等)都应该构建到一个名为 dojo.js 的单一层中。您不需要将 dijit/dijit 显式包含为依赖项,因为您包含的模块已经暗示了它。

标签: dojo dojo-build


【解决方案1】:

检查你的拼写数字->dijit

【讨论】:

  • 谢谢,那只是输入错误。个人资料文件没有“数字”
  • 你应该更正你的问题,上面。此外,如果您可以提供更多有关该错误的上下文 - 您能否识别 _5c4 出现的周围行?是你的代码还是道场的?
  • dojo.js 中出现 _5c4 错误。我还注意到浏览器尝试包含 selector/acme.js,我没有将其移至 Web 服务器。我以为我只需要移动 dojo.js?
  • 您最好将整个树移动到网络服务器,至少您的构建工作正常并且知道发生了什么。为了将选择器/acme 烘焙到图层文件中,您需要使用 selectorEngine 选项。您可以在 Dojo 网站上找到(教程)[dojotoolkit.org/documentation/tutorials/1.7/build/]。相关文档链接位于该教程的底部
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-09-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-09-23
  • 1970-01-01
相关资源
最近更新 更多