Skip to content

Commit

Permalink
chore(babel): add task to run all babel subtasks in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
amit-bansil committed Aug 2, 2016
1 parent 482737c commit 9417503
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand Down Expand Up @@ -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;
}
Expand All @@ -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));
Expand All @@ -99,4 +103,5 @@ function babelize(taskName, dir){
babelize('hooks');
babelize('www');
babelize('tests');
babelize('testbed', 'testbed/www/js');
babelize('testbed', 'testbed/www/js');
gulp.task('babel', babelTasks);

0 comments on commit 9417503

Please sign in to comment.