Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 479 Bytes

exports-as-tasks.md

File metadata and controls

22 lines (17 loc) · 479 Bytes

Exports as Tasks

Using the ES2015 module syntax you can use your exports as tasks.

import gulp from 'gulp';
import babel from 'gulp-babel';

// named task
export function build() {
  return gulp.src('src/*.js')
    .pipe(babel())
    .pipe(gulp.dest('lib'));
}

// default task
export default function dev() {
  gulp.watch('src/*.js', ['build']);
}

This will not work with the gulp-cli version bundled with gulp 3.x. You must use the latest published version.