我正在尝试从旧的dojo构建系统切换到新的dojo构建系统。我一直在拉我的头发,但我似乎无法获得构建脚本来获取我在建筑物配置文件中指定的自定义路径映射。所以,如果我的项目结构如下:
/www/dojo
/www/dojox
/www/dijit
/www/app.profile.js
/www/myapp/package.json #links to myapp.profile.js
/www/myapp/myapp.profile.js #standard package profile stub
#with test,copyOnly,amd
/www/myapp/main.js
/www/myapp/bar/hello.js
/www/myapp/bar/sometext.html
文件如下所示:
//-------------------------------------------
//FILE: app.profile.js
//-------------------------------------------
var profile = (function(){
return {
basePath: ".",
releaseDir: "builds",
releaseName: "v0_0_1",
optimize: "closure",
cssOptimize: "comments",
action: "release",
packages:[
{
name: "dojo",
location: "dojo/dojo"
},
{
name: "myapp",
location: "myapp"
}
],
prefixes: {
"foo": "bar" //doesn't seem to work?
},
paths: {
"foo": "bar" //doesn't seem to work?
},
loaderConfig:{
paths: {
"foo": "bar" //doesn't seem to work?
},
},
layers: {
"mypp/myapp-release": {
include: [
"myapp/main"
]
}
}
};
})();
//--------------------------------------
//FILE: main.js
//--------------------------------------
require(["dojo/_base/html", "foo/hello", "dojo/text!foo/sometext.html"],
function(html, Bar, sometext){
alert(sometext);
}
);
//--------------------------------------
//FILE: hello.js
//--------------------------------------
require([ ],
function(){
alert("hello!");
}
);
我正在运行build命令:
node /www/dojo/dojo.js load=build /www/app.profile.js
构建脚本会告诉我找不到依赖项“foo / hello”,即使它应该映射到bar / hello.js; foo / sometext.html也是如此。
任何帮助都会非常感激;我不想继续拉我的头发直到我秃头! :d