Skip to content

Commit fa1dbad

Browse files
committed
1 parent 5c846cf commit fa1dbad

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

API.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ gulp.task('mytask', ['array', 'of', 'task', 'names'], function() {
117117

118118
**注意:** 你的任务是否在这些前置依赖的任务完成之前运行了?请一定要确保你所依赖的任务列表中的任务都使用了正确的异步执行方式:使用一个 callback,或者返回一个 promise 或 stream。
119119

120+
你也可以省略最后那个函数,如果你只是想要执行依赖的任务:
121+
122+
```js
123+
gulp.task('mytask', ['array', 'of', 'task', 'names']);
124+
```
125+
126+
**注意:** 这些任务会一次并发执行,因此,请不要假定他们会按顺序开始和结束。
127+
120128
#### fn
121129

122130
该函数定义任务所要执行的一些操作。通常来说,它会是这种形式:`gulp.src().pipe(someplugin())`

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
* [API 文档](API.md) - 学习 gulp 的输入和输出方式
55
* [CLI 文档](CLI.md) - 学习如何执行任务(task)以及如何使用一些编译工具
66
* [编写插件](writing-a-plugin/README.md) - 所以,你已经在写一个 gulp 插件了么? 去这儿看一些基本文档,并了解下什么样的事情不应该做
7-
* [英文文档][EnglishDocs] - gulp 英文文档.
8-
7+
* [英文文档][EnglishDocs] - gulp Elglish documentation.
8+
* [西班牙语文档][SpanishDocs] - gulp en Español.
9+
* [韩文文档][KoreanDocs] - gulp 한국어 참조 문서.
910

1011
## 常见问题
1112

@@ -54,3 +55,5 @@ All the documentation is covered by the CC0 license *(do whatever you want with
5455
To the extent possible under law, [Fractal](http://wearefractal.com) has waived all copyright and related or neighboring rights to this work.
5556

5657
[EnglishDocs]: https://github.com/gulpjs/gulp/tree/master/docs
58+
[SpanishDocs]: https://github.com/bucaran/gulp-docs-es
59+
[KoreanDocs]: https://github.com/preco21/gulp-docs-ko

recipes/browserify-with-globs.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,7 @@ gulp.task('javascript', function () {
3838

3939
// "globby" 替换了往常的 "gulp.src" 为 Browserify
4040
// 创建的可读 stream。
41-
globby(['./entries/*.js'], function(err, entries) {
42-
// 确保任何从 globby 发生的错误都被捕获到
43-
if (err) {
44-
bundledStream.emit('error', err);
45-
return;
46-
}
41+
globby(['./entries/*.js']).then(function(entries) {
4742

4843
// 创建 Browserify 实例
4944
var b = browserify({
@@ -55,6 +50,9 @@ gulp.task('javascript', function () {
5550
// 将 Browserify stream 接入到我们之前创建的 stream 中去
5651
// 这里是 gulp 式管道正式开始的地方
5752
b.bundle().pipe(bundledStream);
53+
}).catch(function(err) {
54+
// ensure any errors from globby are handled
55+
bundledStream.emit('error', err);
5856
});
5957

6058
// 最后,我们返回这个 stream,这样 gulp 会知道什么时候这个任务会完成

0 commit comments

Comments
 (0)