Commit 99402ef 1 parent 9f5ec9f commit 99402ef Copy full SHA for 99402ef
File tree 2 files changed +21
-0
lines changed
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 22
22
* [ Browserify + Globs] ( browserify-with-globs.md )
23
23
* [ Output both a minified and non-minified version] ( minified-and-non-minified.md )
24
24
* [ Templating with Swig and YAML front-matter] ( templating-with-swig-and-yaml-front-matter.md )
25
+ * [ Exports as tasks] ( exports-as-tasks.md )
Original file line number Diff line number Diff line change
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
+ ```
You can’t perform that action at this time.
0 commit comments