Skip to content

Commit 363abf7

Browse files
committed
use global require instead of local require in i18n/build. fixes #13
1 parent b65ea22 commit 363abf7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

i18n/build.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
define(["./common", "require"], function (common, requirejs) {
1+
define(["./common"], function (common) {
22
var bundlesList = [],
33
localesList,
44
layerMid,
@@ -24,7 +24,7 @@ define(["./common", "require"], function (common, requirejs) {
2424
getAllAvailableLocales = function () {
2525
localesList = [];
2626
bundlesList.forEach(function (name) {
27-
var root = requirejs(getMasterMid(name));
27+
var root = require(getMasterMid(name));
2828

2929
eachProp(root, function (loc) {
3030
if (root[loc] && localesList.indexOf(loc) < 0) {
@@ -37,7 +37,7 @@ define(["./common", "require"], function (common, requirejs) {
3737

3838
normalizeRoot = function (bundle, name) {
3939
bundle.root = (bundle.root === true || bundle.root === 1) ?
40-
requirejs(name.prefix + "root/" + name.suffix) : bundle.root;
40+
require(name.prefix + "root/" + name.suffix) : bundle.root;
4141
return bundle;
4242
},
4343

@@ -60,13 +60,13 @@ define(["./common", "require"], function (common, requirejs) {
6060
localizedBundle;
6161

6262
if (arguments.length === 2) {
63-
root = normalizeRoot(requirejs(getMasterMid(name)), name);
63+
root = normalizeRoot(require(getMasterMid(name)), name);
6464
}
6565

6666
if (loc !== "root") {
6767
while (loc && loc !== "root") {
6868
if (root[loc]) {
69-
localizedBundle = requirejs(name.prefix + loc + "/" + name.suffix);
69+
localizedBundle = require(name.prefix + loc + "/" + name.suffix);
7070
mixin(result, localizedBundle);
7171
}
7272
loc = common.getParentLocale(loc);
@@ -102,7 +102,7 @@ define(["./common", "require"], function (common, requirejs) {
102102
var layersContent = {};
103103

104104
bundlesList.forEach(function (name) {
105-
var root = normalizeRoot(requirejs(getMasterMid(name)), name),
105+
var root = normalizeRoot(require(getMasterMid(name)), name),
106106
pseudoRoots = getPseudoRoots(root);
107107

108108
localesList.forEach(function (loc) {

0 commit comments

Comments
 (0)