From 32e14790c4989e2f38569da09ead7f330dc54ba3 Mon Sep 17 00:00:00 2001 From: Dennis Date: Thu, 28 May 2015 14:48:01 -0700 Subject: [PATCH] Fixes for generateMomentWithLocales --- tasks/transpile.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tasks/transpile.js b/tasks/transpile.js index e0db865bc..d253407d1 100644 --- a/tasks/transpile.js +++ b/tasks/transpile.js @@ -141,7 +141,15 @@ module.exports = function (grunt) { throw new Error('Failed to detect get default crap, check /tmp/crap.js'); } code = code.replace(getDefaultRegExp, ''); - code = code.replace('var moment_with_locales = ' + crap[1], 'var moment_with_locales = ' + crap[2]); + + var buildExportVars = ['moment_with_locales', 'moment_with_locales_custom']; + buildExportVars.forEach(function (buildExportVar) { + var languageReset = buildExportVar + '.locale(\'en\');'; + code = code.replace('var ' + buildExportVar + ' = ' + crap[1] + ';', + 'var ' + buildExportVar + ' = ' + crap[2] + ';\n' + + ' ' + languageReset); + }); + if (code.match('get default')) { grunt.file.write('/tmp/crap.js', code); throw new Error('Stupid shit es6 get default plaguing the code, check /tmp/crap.js'); -- 2.47.2