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

How to exclude dojo files from a layer when creating a DOJO custom build?

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

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

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

error(304) Missing exclude module for layer. missing: dojo/_base/declare; layer: app/app missing: dojo/topic; layer: app/app

能否请您指出正确的方向并解决该错误?

注意:我正在使用 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
        }
    };

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

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