Skip to content

Commit b41553a

Browse files
committed
Revert "avoid multiple mapping for a built nls bundle"
This reverts commit 6a2b275 as it causes regression during the build.
1 parent b8b7e64 commit b41553a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

i18n/build.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
define(["./common"], function (common) {
2-
var bundles = {},
2+
var bundlesList = [],
33
localesList,
44
layerMid,
55

@@ -23,7 +23,7 @@ define(["./common"], function (common) {
2323

2424
getAllAvailableLocales = function () {
2525
localesList = [];
26-
Object.keys(bundles).forEach(function (name) {
26+
bundlesList.forEach(function (name) {
2727
var root = require(getMasterMid(name));
2828

2929
eachProp(root, function (loc) {
@@ -82,7 +82,7 @@ define(["./common"], function (common) {
8282

8383
return {
8484
addBundleToNlsLayer: function (name) {
85-
bundles[name] = true;
85+
bundlesList.push(name);
8686
},
8787

8888
setLocalesList: function (locList) {
@@ -93,15 +93,15 @@ define(["./common"], function (common) {
9393
},
9494

9595
reset: function () {
96-
bundles = {};
96+
bundlesList = [];
9797
localesList = undefined;
9898
layerMid = undefined;
9999
},
100100

101101
getLayersContent: function () {
102102
var layersContent = {};
103103

104-
Object.keys(bundles).forEach(function (name) {
104+
bundlesList.forEach(function (name) {
105105
var root = normalizeRoot(require(getMasterMid(name)), name),
106106
pseudoRoots = getPseudoRoots(root);
107107

@@ -134,7 +134,7 @@ define(["./common"], function (common) {
134134
},
135135

136136
writeConfig: function (pluginName, data, write) {
137-
var bundlesList = Object.keys(bundles).map(getMasterMid),
137+
var bundles = bundlesList.map(getMasterMid),
138138
layerMid = getLayerMid(data),
139139
i18nConf = {
140140
config: {}
@@ -143,7 +143,7 @@ define(["./common"], function (common) {
143143
bundlesMap: {},
144144
localesMap: {}
145145
};
146-
i18nConf.config[pluginName].bundlesMap[layerMid] = bundlesList;
146+
i18nConf.config[pluginName].bundlesMap[layerMid] = bundles;
147147
i18nConf.config[pluginName].localesMap[layerMid] = localesList;
148148

149149
// write i18n config on the layer

0 commit comments

Comments
 (0)