如何在创建DOJO自定义构建时从图层中排除dojo文件?

时间:2015-11-20 11:17:02

标签: javascript dojo

我需要从图层中排除dojo依赖项。

基本上,app/Message.js包含两个对dojo ["dojo/_base/declare", "dojo/topic"]的引用,但我需要在创建的层中保留dojo代码购买构建器。

目前我正在使用以下代码,但收到错误:

  

错误(304)缺少图层的排除模块。失踪:   道场/ _base / DECLARE; layer:app / app missing:dojo / topic;层:   应用程序/应用

你能指出我正确的方向并解决这个错误吗?

注意:我使用dojo 1.10

var profile = {
        basePath: "../src/",
        action: "release",
        cssOptimize: "comments",
        mini: true,
        useSourceMaps: false,
        optimize: "closure",
        layerOptimize: "closure",
        packages: ["app"],
        stripConsole: "all",
        selectorEngine: "lite",
        layers: {
            "dojo/dojo": {
                boot: true,
                customBase: true
            },
            "app/app": {
                include: ["app/Message","app/Sender"],
                exclude: ["dojo/_base/declare", "dojo/topic"]
            }
        },
        staticHasFeatures: {
            "dojo-trace-api": !1,
            "dojo-log-api": !1,
            "dojo-publish-privates": !1,
            "dojo-sync-loader": !1,
            "dojo-xhr-factory": !1,
            "dojo-test-sniff": !1
        }
    };

1 个答案:

答案 0 :(得分:0)

您需要在包中列出dojo以及要在层中构建的任何其他库。

var profile = {
    ...
    packages: ["app","dojo"],
    ...
};