Skip to content

Commit

Permalink
[locale] fix: importing locales using path.resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
Ventsislav Dimitrov committed Oct 25, 2019
1 parent 13a61b2 commit 9bcd450
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion moment.js
Expand Up @@ -1850,7 +1850,8 @@
try {
oldLocale = globalLocale._abbr;
var aliasedRequire = require;
aliasedRequire('./locale/' + name);
var path = aliasedRequire('path');
aliasedRequire(path.resolve(__dirname, './locale/' + name));
getSetGlobalLocale(oldLocale);
} catch (e) {}
}
Expand Down
3 changes: 2 additions & 1 deletion src/lib/locale/locales.js
Expand Up @@ -53,7 +53,8 @@ function loadLocale(name) {
try {
oldLocale = globalLocale._abbr;
var aliasedRequire = require;
aliasedRequire('./locale/' + name);
var path = aliasedRequire('path');
aliasedRequire(path.resolve(__dirname, './locale/' + name));
getSetGlobalLocale(oldLocale);
} catch (e) {}
}
Expand Down

0 comments on commit 9bcd450

Please sign in to comment.