我的问题,虽然起初有点类似于
this one,但似乎是一个更基本的问题 – 可能是构建系统中的一个错误信号.我为我的dojo应用程序创建了一个自定义构建.我现在只构建一个图层,这是配置文件脚本/对象的样子:
dependencies = { stripConsole: "all",action: "release",optimize: "shrinksafe",releaseName: "myProject",// list of locales we want to expose localeList: "en-gb,en-us,de-de",layers: [ { // Name: a relative path from the dojo.js in the desination directory. name: "../../myProject.js",dependencies: [ "myPackage.MyDataStore",// MyWidget depends on a few other widgets,and has its own // translation files. "myPackage.MyWidget" ] } ],prefixes: [ // These paths are relative to the location of dojo.js [ "dijit","../dijit" ],[ "dojox","../dojox" ],[ "myPackage","../../../src/myPackage" ] ] }
release/ release/myProject/ release/myProject/dijit/ ... dijit ... release/myProject/dojo/ ... dojo ... release/myProject/dojox/ ... dojox ... release/myProject/myPackage/ ... my custom package ... release/nls/ myProject_en-us.js myProject_de.js etc.. ../myproject.js ../myProject.js.uncompressed.js
<script type="text/javascript"> var djConfig = { debug: true,parSEOnLoad: false,modulePaths: { // paths to directories in relation to dojo's location.... hurr. 'myPackage': '../myPackage','dojox': '../dojox','dijit': '../dijit' } }; </script> <script type="text/javascript" src="./release/myProject/dojo/dojo.js.uncompressed.js"></script> <script type="text/javascript" src="./release/myProject.js.uncompressed.js"></script> <script type="text/javascript"> dojo.addOnLoad(function(){ dojo.require('myPackage.MyDataStore'); dojo.require('myPackage.MyWidget'); var store = new myPackage.MyDataStore(); var widget = new myPackage.MyWidget({ store: store },dojo.byId('testWidget')); widget.startup(); }); </script>
但不幸的是,Firebug向我吐了出来:
Bundle not found: MyWidget in myPackage,locale=en-us
我认为发生了什么
我已经跟踪了导致上述错误的一些代码,似乎文件末尾的dojo.i18n._preloadLocalizations()调用实际上没有从./release/nls加载到正确的nls文件中.