From: Iskren Chernev Date: Sat, 29 Oct 2016 14:33:51 +0000 (+0100) Subject: Fix transpile-row and make linter happy X-Git-Tag: 2.16.0~24^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1e6947c7987184f9f1872041a894f9d4d67cb86;p=thirdparty%2Fmoment.git Fix transpile-row and make linter happy --- diff --git a/tasks/transpile.js b/tasks/transpile.js index 517e90da7..bc54b3241 100644 --- a/tasks/transpile.js +++ b/tasks/transpile.js @@ -34,7 +34,7 @@ module.exports = function (grunt) { var headerCache = {}; function getHeaderByFile(headerFile) { - if (headerFile == 'none') { + if (headerFile === 'none') { return ''; } if (!(headerFile in headerCache)) { @@ -47,18 +47,28 @@ module.exports = function (grunt) { // entry, umdName, skipMoment var rollupOpts = { - entry: opts.entry, - plugins: [ - babel({}) - ] + entry: opts.entry, + plugins: [ + babel({}) + ] }, bundleOpts = { - format: 'umd', - moduleName: opts.umdName != null ? opts.umdName : 'not_used' + format: 'umd', + moduleName: opts.umdName != null ? opts.umdName : 'not_used' }; if (opts.skipMoment) { - rollupOpts.external = ['./moment', '../moment', '../../moment', path.resolve('build/tmp/moment'), path.resolve('src/moment')]; - bundleOpts.globals = {[path.resolve('src/moment')]: 'moment', [path.resolve('build/tmp/moment')]: 'moment'}; + // And this is what people call progress? + rollupOpts.external = [ + './moment', + '../moment', + '../../moment', + path.resolve('src/moment'), + path.resolve('build/tmp/moment') + ]; + bundleOpts.globals = { + [path.resolve('src/moment')]: 'moment', + [path.resolve('build/tmp/moment')]: 'moment' + }; } return rollup(rollupOpts).then(function (bundle) { @@ -184,7 +194,7 @@ module.exports = function (grunt) { skipLines: 7, moveComments: true, targetDir: 'build/umd', - skipMoment: true, + skipMoment: true }); }).then(function () { grunt.log.ok('build/umd/locale/*.js'); @@ -256,12 +266,16 @@ module.exports = function (grunt) { } return generateLocales( - 'build/umd/min/locales.custom.js', localeFiles + 'build/umd/min/locales.custom.js', + localeFiles, + {skipMoment: true} ).then(function () { grunt.log.ok('build/umd/min/locales.custom.js'); }).then(function () { - return generateMomentWithLocales('build/umd/min/moment-with-locales.custom.js', - localeFiles); + return generateLocales( + 'build/umd/min/moment-with-locales.custom.js', + localeFiles, + {skipMoment: false}); }).then(function () { grunt.log.ok('build/umd/min/moment-with-locales.custom.js'); }).then(done, function (e) {