var path = require('path');
var gulp = require('gulp');
var eslint = require('gulp-eslint');
var excludeGitignore = require('gulp-exclude-gitignore');
var nsp = require('gulp-nsp');
var babel = require('gulp-babel');
var del = require('del');

// Initialize the babel transpiler so ES2015 files gets compiled
// when they're loaded
require('@babel/register');

gulp.task('static', function() {
  return gulp
    .src('**/*.js')
    .pipe(excludeGitignore())
    .pipe(eslint())
    .pipe(eslint.format())
    .pipe(eslint.failAfterError());
});

gulp.task('nsp', function(cb) {
  nsp({ package: path.resolve('package.json') }, cb);
});

gulp.task('clean', function() {
  return del('dist');
});

gulp.task('babel', ['clean'], function() {
  return gulp
    .src('lib/**/*.js')
    .pipe(babel())
    .pipe(gulp.dest('dist'));
});

gulp.task('prepublish', ['babel']);

@@ -1,63 +1,92 @@
-var path = require('path');%0Avar gulp = require('gulp');%0Avar
+const %7B task, series, src, dest %7D = require('gulp');%0Aconst path = require('path');%0Aconst
  esl
@@ -115,19 +115,21 @@
 lint');%0A
-var
+const
  exclude
@@ -175,19 +175,21 @@
 nore');%0A
-var
+const
  nsp = r
@@ -208,19 +208,21 @@
 -nsp');%0A
-var
+const
  babel =
@@ -249,11 +249,13 @@
 ');%0A
-var
+const
  del
@@ -387,29 +387,24 @@
 egister');%0A%0A
-gulp.
 task('static
@@ -406,26 +406,21 @@
 tatic', 
-function()
+() =%3E
  %7B%0A  ret
@@ -419,34 +419,24 @@
  %7B%0A  return 
-gulp%0A    .
 src('**/*.js
@@ -552,29 +552,24 @@
 or());%0A%7D);%0A%0A
-gulp.
 task('nsp', 
@@ -572,20 +572,13 @@
 p', 
-function(cb)
+cb =%3E
  %7B%0A 
@@ -639,37 +639,31 @@
 );%0A%0A
-gulp.task('clean', function()
+const cleanTask = () =%3E
  %7B%0A 
@@ -688,52 +688,34 @@
 );%0A%7D
-)
 ;%0A%0A
-gulp.task('babel', %5B'clean'%5D, function()
+const babelTask = () =%3E
  %7B%0A 
@@ -726,18 +726,8 @@
 urn 
-gulp%0A    .
 src(
@@ -770,21 +770,16 @@
   .pipe(
-gulp.
 dest('di
@@ -790,17 +790,84 @@
 );%0A%7D
-);%0A%0Agulp.
+;%0A%0Atask('clean', cleanTask);%0A%0Atask('build', series(cleanTask, babelTask));%0A%0A
 task
@@ -885,16 +885,24 @@
 h', 
-%5B'babel'%5D
+series(babelTask)
 );%0A

update gulpfile