@@ -59,7 +59,7 @@ The path (folder) to write files to.
59
59
Define a task using [ Orchestrator] .
60
60
61
61
``` javascript
62
- gulp .task (' somename' , function () {
62
+ gulp .task (' somename' , function () {
63
63
// Do stuff
64
64
});
65
65
```
@@ -74,7 +74,7 @@ Type: `Array`
74
74
An array of tasks to be executed and completed before your task will run.
75
75
76
76
``` javascript
77
- gulp .task (' mytask' , [' array' , ' of' , ' task' , ' names' ], function () {
77
+ gulp .task (' mytask' , [' array' , ' of' , ' task' , ' names' ], function () {
78
78
// Do stuff
79
79
});
80
80
```
@@ -93,7 +93,7 @@ Tasks can be made asynchronous if its `fn` does one of the following:
93
93
##### Accept a callback
94
94
95
95
``` javascript
96
- gulp .task (' somename' , function (cb ) {
96
+ gulp .task (' somename' , function (cb ) {
97
97
// Do stuff
98
98
cb (err);
99
99
});
@@ -102,7 +102,7 @@ gulp.task('somename', function (cb) {
102
102
##### Return a stream
103
103
104
104
``` javascript
105
- gulp .task (' somename' , function () {
105
+ gulp .task (' somename' , function () {
106
106
var stream = gulp .src (' ./client/**/*.js' )
107
107
.pipe (minify ())
108
108
.pipe (gulp .dest (' /build' ));
@@ -115,11 +115,11 @@ gulp.task('somename', function () {
115
115
``` javascript
116
116
var Q = require (' q' );
117
117
118
- gulp .task (' somename' , function () {
118
+ gulp .task (' somename' , function () {
119
119
var deferred = Q .defer ();
120
120
121
121
// Do async stuff
122
- setTimeout (function () {
122
+ setTimeout (function () {
123
123
deferred .resolve ();
124
124
}, 1 );
125
125
@@ -146,13 +146,13 @@ So this example would look like this:
146
146
var gulp = require (' gulp' );
147
147
148
148
// takes in a callback so the engine knows when it'll be done
149
- gulp .task (' one' , function (cb ) {
149
+ gulp .task (' one' , function (cb ) {
150
150
// do stuff -- async or otherwise
151
151
cb (err); // if err is not null and not undefined, the run will stop, and note that it failed
152
152
});
153
153
154
154
// identifies a dependent task must be complete before this one begins
155
- gulp .task (' two' , [' one' ], function () {
155
+ gulp .task (' two' , [' one' ], function () {
156
156
// task 'one' is done now
157
157
});
158
158
@@ -183,7 +183,7 @@ Names of task(s) to run when a file changes, added with `gulp.task()`
183
183
184
184
``` javascript
185
185
var watcher = gulp .watch (' js/**/*.js' , [' uglify' ,' reload' ]);
186
- watcher .on (' change' , function (event ) {
186
+ watcher .on (' change' , function (event ) {
187
187
console .log (' File ' + event .path + ' was ' + event .type + ' , running tasks...' );
188
188
});
189
189
```
@@ -206,7 +206,7 @@ Type: `Function`
206
206
Callback to be called on each change.
207
207
208
208
``` javascript
209
- gulp .watch (' js/**/*.js' , function (event ) {
209
+ gulp .watch (' js/**/*.js' , function (event ) {
210
210
console .log (' File ' + event .path + ' was ' + event .type + ' , running tasks...' );
211
211
});
212
212
```
0 commit comments