From 9417503efbf2c9b270d51ef5aaff7c3f9c5efb13 Mon Sep 17 00:00:00 2001 From: Amit Bansil Date: Tue, 2 Aug 2016 18:13:46 -0400 Subject: [PATCH] chore(babel): add task to run all babel subtasks in parallel --- gulpfile.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 94a6c789..8712f8e0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -15,6 +15,8 @@ gulp.task('setupNpm', () => { setIosNpmOrDev('npm'); }); +gulp.task('build-npm', ['setupNpm', 'babel']); + //generate plugin.xml for use as a cordova plugin //here we explode the contents of the frameworks function genNpmPluginXML(){ @@ -74,7 +76,9 @@ function emitFiles(path){ } //copy resources and compile es6 from corresponding directory +babelTasks = []; //list of all babel tasks so we can build all of them function babelize(taskName, dir){ + babelTasks.push(taskName + '-babel'); if(!dir){ dir = taskName; } @@ -89,7 +93,7 @@ function babelize(taskName, dir){ .pipe(sourcemaps.init()) .pipe(babel({ presets: ['es2015', 'stage-2'], - plugins: ['transform-runtime'] + plugins: ['transform-runtime'] //needed for generators etc })) .pipe(sourcemaps.write('.')) .pipe(gulp.dest(destDir)); @@ -99,4 +103,5 @@ function babelize(taskName, dir){ babelize('hooks'); babelize('www'); babelize('tests'); -babelize('testbed', 'testbed/www/js'); \ No newline at end of file +babelize('testbed', 'testbed/www/js'); +gulp.task('babel', babelTasks); \ No newline at end of file