From: Iskren Chernev Date: Fri, 1 May 2020 18:31:27 +0000 (+0300) Subject: [bugfix] Revert changes made for #5269 due to webpack warnings X-Git-Tag: 2.25.1~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e268635299d6c1684f1b9ab5b94d30cbd338d61;p=thirdparty%2Fmoment.git [bugfix] Revert changes made for #5269 due to webpack warnings --- diff --git a/src/lib/locale/locales.js b/src/lib/locale/locales.js index 14ff7cf00..0d0823275 100644 --- a/src/lib/locale/locales.js +++ b/src/lib/locale/locales.js @@ -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