From: yiminghe Date: Tue, 2 Aug 2016 10:50:14 +0000 (+0800) Subject: use module.require for nodejs X-Git-Tag: 2.15.0~17^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8ed716c55cdf7ca77a0e960249e9e0291fa8299;p=thirdparty%2Fmoment.git use module.require for nodejs --- diff --git a/src/lib/locale/locales.js b/src/lib/locale/locales.js index abdafcea7..ba64626eb 100644 --- a/src/lib/locale/locales.js +++ b/src/lib/locale/locales.js @@ -48,10 +48,10 @@ function loadLocale(name) { var oldLocale = null; // TODO: Find a better way to register and load all the locales in Node if (!locales[name] && (typeof module !== 'undefined') && - module && module.exports) { + module && module.require) { try { oldLocale = globalLocale._abbr; - require('./locale/' + name); + module.require('./locale/' + name); // because defineLocale currently also sets the global locale, we // want to undo that for lazy loaded locales getSetGlobalLocale(oldLocale);