From: Iskren Chernev Date: Fri, 1 May 2020 18:32:18 +0000 (+0300) Subject: [misc] Build es bundle (unused for now) X-Git-Tag: 2.25.1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3bfb450d62096da1cc7f5224a65abe8b640a9243;p=thirdparty%2Fmoment.git [misc] Build es bundle (unused for now) --- diff --git a/tasks/transpile.js b/tasks/transpile.js index 586c7dba2..9f594d7bc 100644 --- a/tasks/transpile.js +++ b/tasks/transpile.js @@ -37,7 +37,7 @@ module.exports = function (grunt) { ], }, bundleOpts = { - format: 'umd', + format: opts.format != null ? opts.format : 'umd', name: opts.umdName != null ? opts.umdName : 'not_used', }; @@ -81,6 +81,7 @@ module.exports = function (grunt) { entry: entry, skipMoment: opts.skipMoment != null ? opts.skipMoment : false, umdName: umdName, + format: opts.format, }).then(function (code) { var fixed = header + code.split('\n').slice(skipLines).join('\n'); if (opts.moveComments) { @@ -193,6 +194,21 @@ module.exports = function (grunt) { .then(function () { grunt.log.ok('build/umd/moment.js'); }) + .then(function () { + return transpile({ + base: 'src', + entry: 'moment.js', + umdName: 'moment', + headerFile: 'templates/empty.js', + target: 'build/esm/moment.js', + format: 'es', + skipLines: 0, + moveComments: true, + }); + }) + .then(function () { + grunt.log.ok('build/esm/moment.js'); + }) .then(function () { return transpileMany({ base: 'src', diff --git a/templates/empty.js b/templates/empty.js new file mode 100644 index 000000000..e69de29bb