Dojo 1.8并构建(或缺少)

前端之家收集整理的这篇文章主要介绍了Dojo 1.8并构建(或缺少)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我真的不知道从哪里开始.

我已经经历了每个教程,文章博客文章,尝试获得一个dojo已经开始工作的东西,从来没有我有这样的问题需要工作,至少只是一点点.我发现火焰战争的文件以及工作脚本的人,但没有发布或概述.在这样的情况下,我发现这是一个很常见的问题,但一半的时间没有解决.

免责声明:忘记1.6.我从来没有使用过1.6.因此,我的一半资源在线查找是无效的,我的书也是如此.开始了.

问题1

有关使用此格式的大量帖子有什么区别?

dependencies = {
    stripConsole: "all",action: "release",optimize: "shrinksafe",// Omitted options...
    layers: [{
        name: "dojo.js",customBase : true,dependencies: [ 
              "dojox.gauges.AnalogNeedleIndicator","myApp.smartmix"]           
        }
    ],prefixes: [
        [ "dijit","../dijit" ],[ "dojox","../dojox" ],[ "myApp","../../../myApp" ]
    ]
};

…对这种格式:

var profile = {
    basePath: './',stripConsole: 'all',selectorEngine: 'lite',layers: {
        'dojo/dojo': {
            include: ['dojo/dojo','dojo/domReady','dojo/_base/declare'],boot: true,customBase: true
        },'dgrid/dgrid': {
            include: ["dgrid/List","dgrid/OnDemandGrid","dgrid/Selection","dgrid/Keyboard","dgrid/test/data/perf"]
        }
    }
    // static-has-features removed
};

两者之间的层次对象有两个非常重要的差异:A)每个人似乎都只是“知道”没有任何理由或理性,或者B)人们似乎“知道”.我还没有找到关于与新的AMD结构和构建系统的重写有关的两种语法(Syntaxis?Syntax’s?)之间的区别的内容.

我看到的最接近的是对象名称并不重要,也没有声明.它可以是一个“全局”变量(省略var关键字),否则,名称无关紧要,只要返回的对象包含必要的信息.

第二种格式给我一个“意外的字符串”错误,99%的时间失败,即使是复制/粘贴的配置文件.

问题2

究竟需要什么? Dojo的文档说,package.json和appName.profile.js文件是必需的,但是在我看到的所有教程中,只需要使用配置文件,并使用它.因此,Dojo的主要网站关于建筑的一半信息不被使用.所以……..?

Dojo网站说使用src版本进行构建. Nabble的一个人说你必须得到svn版本,因为src版本已经“构建”了.

那么谁先开始?

问题3

有没有人,任何人,有一个工作目录结构和profile.js文件,他们会分心?我已经尝试过一切.我确实意味着一切,得到一个建设.一个建议是使用一个空的配置文件对象.这有用,没用.

另一个建议是使用dojo样板生成.如果任何改变打破了模板,什么好的?你尝试过的是一个简单的例子,就像Tony Stark所说,“每一个已知的[javascript对象变体”的排列,没有任何作用.

我很快失去信心不是因为我在尝试和失败的几个小时之后才算出来,而是因为很多人在同一条船上.下沉了

最后问题

所以,我最后的要求是,有人可以请教一下这个构建系统的工作原理,而不仅仅是链接到已经被清除的读取和重新读取的链接

你怎么…配置一个Dojo构建配置文件…并执行它…没有错误?这个系统是多么糟糕的这个系统是有害的A)记录和B)实现,而我在它C)
授课.很疲惫

我访问过的一些(许多)网站:

> Nabble SVN vs. SDK
> SitePen tutorial that… doesn’t produce.
> One “Boilerplate” Profile (from SitePen)
> Dojo Boilerplate Profile (github)
> Dojo Tutorial

更新

非常感谢@xesxz和@Craig Swing.经过一些小小的事情,我有一个构建配置文件,块,并给我我需要的!

What’s the difference between a LOT of posts about using this format…

你的第一个例子就是前面的Dojo 1.7版本.如果您使用1.7或更高版本,您需要第二个例子.

The Dojo site says to use the src release for builds. A guy at Nabble
said you must get the svn version as the src version is already
“built”.

… so who’s on first?

您需要从http://dojotoolkit.org/download/开始的SDK

页面上,它被标记为“源”.这包含一个具有所有构建脚本的util目录,以及包含dojo文件的非构建版本的其他目录.

Does anyone,anyone at all,have a working directory structure and
profile.js file they’d care to share?

我正在处理的项目与@xesxz发布的结构类似.但是,我尝试使用boot:true,customBase:true,没有成功.以下是我的个人资料
(我的目录结构有点不同,所以路径不匹配@xesxz发布).

在我的应用程序中,我将包括以下内容

> dojo / dojo.js
> myCore / core.js
> myAppModuleX / app.js,其中X是我在页面上使用的特定模块.

core.profile.js(用于构建)

var profile = (function(){
     var coreRequires = [
        "dojo/_base/declare","dojo/_base/fx","dojo/_base/lang","dojo/currency","dojo/fx","dojo/number","dojo/on","dojo/query","dijit/dijit","myCore/ACoreWidget"
    ];

    return {
        basePath:       "./dojo-release-1.8.3-src",releaseDir:     "../../DEV-REL",action:         "release",cssOptimize:    "comments",selectorEngine: "acme",packages:[{
            name: "dojo",location: "dojo"
        },{
            name: "dijit",location: "dijit"
        },{
            name: "dojox",location: "dojox"
        },{
            name: "myCoreModule",location: "../myCore"
        },{
            name: "myAppModule1",location: "../myAppModule1"
        },{
            name: "myAppModule2",location: "../myAppModule2"
        }],layers: {
            "myCore/core": {
                include:    coreRequires
            },"myAppModule1/app": {
                include:    [
                    "myAppModule1/WidgetX"
                ],exclude: coreRequires
            },"myAppModule2/app": {
                include:    [
                    "myAppModule2/WidgetY"
                ],exclude: coreRequires
            }
        }
    };
})();

How… do you… configure a Dojo build profile… and execute it… without error?

我使用节点来构建.这将在包含构建配置文件的目录中执行.

node dojo-release-1.8.3-src/dojo/dojo.js load=build --profile core.profile.js --release --version=1.8.3

我的建议是尝试使用一个非常简单的单个自定义窗口小部件完成构建.如果这样工作,那么你真正的小部件

关于意外的字符串,

所有的小部件都使用新的AMD语法?>你有dgrid,但我相信这是依赖put-selector和xStyle的

原文链接:https://www.f2er.com/dojo/290888.html

猜你在找的Dojo相关文章