]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
[bugfix] Revert changes made for #5269 due to webpack warnings
authorIskren Chernev <iskren.chernev@gmail.com>
Fri, 1 May 2020 18:31:27 +0000 (21:31 +0300)
committerIskren Chernev <iskren.chernev@gmail.com>
Fri, 1 May 2020 18:31:27 +0000 (21:31 +0300)
src/lib/locale/locales.js

index 14ff7cf00c24928ea4a41368c8974a30234a29b4..0d082327545c67c3f872b348aab64d8397d896e1 100644 (file)
@@ -64,8 +64,7 @@ function chooseLocale(names) {
 
 function loadLocale(name) {
     var oldLocale = null,
-        aliasedRequire,
-        localePath;
+        aliasedRequire;
     // TODO: Find a better way to register and load all the locales in Node
     if (
         locales[name] === undefined &&
@@ -76,10 +75,7 @@ function loadLocale(name) {
         try {
             oldLocale = globalLocale._abbr;
             aliasedRequire = require;
-            localePath = (typeof __dirname !== 'undefined' ? __dirname : '.') +
-                '/locale/' +
-                name;
-            aliasedRequire(localePath);
+            aliasedRequire('./locale/' + name);
             getSetGlobalLocale(oldLocale);
         } catch (e) {
             // mark as not found to avoid repeating expensive file require call causing high CPU