Skip to content

Commit ce8e94c

Browse files
committed
Merge pull request #1506 from thejameskyle/tjk/export-docs
Add exports as tasks docs
2 parents 9f5ec9f + 99402ef commit ce8e94c

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

docs/recipes/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@
2222
* [Browserify + Globs](browserify-with-globs.md)
2323
* [Output both a minified and non-minified version](minified-and-non-minified.md)
2424
* [Templating with Swig and YAML front-matter](templating-with-swig-and-yaml-front-matter.md)
25+
* [Exports as tasks](exports-as-tasks.md)

docs/recipes/exports-as-tasks.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Exports as Tasks
2+
3+
Using the ES2015 module syntax you can use your exports as tasks.
4+
5+
```js
6+
import gulp from 'gulp';
7+
import babel from 'gulp-babel';
8+
9+
// named task
10+
export function build() {
11+
return gulp.src('src/*.js')
12+
.pipe(babel())
13+
.pipe(gulp.dest('lib'));
14+
}
15+
16+
// default task
17+
export default function dev() {
18+
gulp.watch('src/*.js', ['build']);
19+
}
20+
```

0 commit comments

Comments
 (0)