Skip to content

Commit

Permalink
Add exports as tasks docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiebuilds committed Jan 29, 2016
1 parent 9f5ec9f commit 99402ef
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/recipes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@
* [Browserify + Globs](browserify-with-globs.md)
* [Output both a minified and non-minified version](minified-and-non-minified.md)
* [Templating with Swig and YAML front-matter](templating-with-swig-and-yaml-front-matter.md)
* [Exports as tasks](exports-as-tasks.md)
20 changes: 20 additions & 0 deletions docs/recipes/exports-as-tasks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Exports as Tasks

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

```js
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']);
}
```

0 comments on commit 99402ef

Please sign in to comment.