From 2e268635299d6c1684f1b9ab5b94d30cbd338d61 Mon Sep 17 00:00:00 2001 From: Iskren Chernev Date: Fri, 1 May 2020 21:31:27 +0300 Subject: [PATCH] [bugfix] Revert changes made for #5269 due to webpack warnings --- src/lib/locale/locales.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/lib/locale/locales.js b/src/lib/locale/locales.js index 14ff7cf00c..0d08232754 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