这是我得到的构建失败的升级。症状是与ShrinkSafe的优化,当我的构建会失败,出现错误:如果我的代码在其NLS拉带花纹如dojo构建 - nls包,除非包中包含“dojo/dojo”,否则构建失败?
"dojo/i18n!./nls/MyResource"
但是文件
[exec] js: "<eval'ed string>#1(Function)#1(eval)", line 127: uncaught JavaScript runtime exception: TypeError: Cannot read property "1" from null
[exec] at <eval'ed string>#1(Function)#1(eval):127
[exec] at <eval'ed string>#1(Function)#1(eval):163
,这种结构始终是常见很多dojo代码,它们干净地构建。所以我尝试了将一些dojo代码复制到我的模块中,并发现如果nls资源被加载到dojo/dojo层,那么我的图层构建正确,如果我在自己的图层中加载了相同的nls资源,那么我们就会失败。
所以切割这一直到最小的情况下,我复制的dijit /表格/ _ComboBoxMenuMixin.js我自己的模块以及相应的NLS资源。
我有三个测试用例,其中一个有效,另外两个给出上述失败。
我的问题:
好像我需要包括在“道场/道场”层我自己的NLS资源,它必须是精确的这一层。当然这不可能是对的?我有什么选择?
工作概况:
layers: {
"dojo/dojo" : {
customBase: false,
include: [
"modules/nls/ComboBox",
],
exclude: []
},
"MyLayer" : {
customBase: false,
include: [
"modules/ComboCopy",
],
exclude: []
},
}
失败:在同一层NLS
layers: {
"dojo/dojo" : {
customBase: false,
include: [
],
exclude: []
},
"MyLayer" : {
customBase: false,
include: [
"modules/nls/ComboBox",
"modules/ComboCopy",
],
exclude: []
},
}
故障,在不同的层的名称负载NLS
layers: {
"myNlsLayer" : {
customBase: false,
include: [
"modules/nls/ComboBox",
],
exclude: []
},
"MyLayer" : {
customBase: false,
include: [
"modules/ComboCopy",
],
exclude: []
},