2015-11-20 33 views
4

我需要排除來自圖層的dojo依賴關係。如何在創建DOJO自定義構建時從圖層中排除dojo文件?

基本上,app/Message.js包含兩個引用dojo ["dojo/_base/declare", "dojo/topic"]但我需要在dojo代碼中創建購買builder。

目前我使用下面的代碼,但我收到一個錯誤:

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 
     } 
    }; 
+1

相關文檔:http://dojotoolkit.org/reference-guide/1.10/build/transforms/writeAmd.html – GibboK

回答

0

你需要列出道場在你的包以及你想建立到你的層的任何其他庫。

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