]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
use module.require for nodejs
authoryiminghe <yiminghe@gmail.com>
Tue, 2 Aug 2016 10:50:14 +0000 (18:50 +0800)
committerIskren Chernev <iskren.chernev@gmail.com>
Sat, 3 Sep 2016 05:58:36 +0000 (22:58 -0700)
src/lib/locale/locales.js

index abdafcea7c2be2c181c52f78cb449e7bf50926c7..ba64626eb8f42d6e75fa939769298b9666a20ea0 100644 (file)
@@ -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);