您可以在下面看到
my app.profile.js
文件的内容。我从命令提示符中执行"build profile=../../app.profile.js -r"
这行代码,并且在完成后没有出现任何错误。我的问题是,如果我将这些软件包的发布(已构建)版本复制到未构建版本存在的位置,我就会遇到太多的JavaScript错误,例如"Error: multipleDefine
"。即使我只复制dojo、dojox和dijit文件夹,仍然会出现相同的错误。当我查看两个js文件(例如dojo/Deferred)的构建和未构建之间的差异时,我唯一意识到的区别是:
//built
define("dojo/Deferred", [
"./_base/lang",
"./promise/CancelError",
"./promise/Promise"
], function(
define([
"./_base/lang",
"./promise/CancelError",
"./promise/Promise"
], function(
我有点卡在了开始的阶段。我想尽快使用层来减少HTTP请求,但我需要关于我提到的情况的帮助。非常感谢任何帮助。
app.profile.js:
var profile = {
basePath: "..",
layerOptimize: "shrinksafe.keepLines",
optimize: "shrinksafe",
releaseDir: "./release",
hasReport: true,
packages: [
{
name: "dojo",
location: "./dojo"
},
{
name: "dijit",
location: "./dijit"
},
{
name: "app",
location: "./app"
},
{
name: "dtk",
location: "./dtk"
},
{
name: "dojox",
location: "./dojox"
}
],
layers: {
"app/layers/core": {
include: [
"dojo/_base/declare",
"dtk/core/ILifeCycle",
"dtk/core/AppConfig",
"dtk/core/TopicContext",
"dtk/core/NavigationContext",
"dojo/require",
"dojo/_base/Deferred",
"dojo/DeferredList",
"dojo/_base/lang"
]
},
"app/layers/appcontext": {
include: [
"dtk/core/AppContext"
],
exclude: [
"app/layers/core"
]
}
}
};