diff --git a/src/utils/moment-loader.js b/src/utils/moment-loader.js index 1649fc9806..7ae0a0e42c 100644 --- a/src/utils/moment-loader.js +++ b/src/utils/moment-loader.js @@ -36,9 +36,10 @@ function getCachedAndCleanModules (modulePath) { delete require.cache[modulePath]; - require(modulePath); + const cleanModuleExports = require(modulePath); + const cleanModule = require.cache[modulePath] || { exports: cleanModuleExports }; - return { cachedModule, cleanModule: require.cache[modulePath] }; + return { cachedModule, cleanModule }; } function getMomentModules ({ mainMomentModulePath, sideMomentModulePath }) {