You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/API.md
+53Lines changed: 53 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -682,6 +682,59 @@ gulp.tree({ deep: true })
682
682
*/
683
683
```
684
684
685
+
### gulp.registry([registry])
686
+
687
+
Get or set the underlying task registry. Inherited from [undertaker]; see the undertaker documention on [registries](https://github.com/phated/undertaker#registryregistryinstance). Using this, you can change registries that enhance gulp in different ways. Utilizing a custom registry has at least three use cases:
-[Sharing functionality](https://github.com/phated/undertaker#sharing-functionalities). (e.g. you could override the task prototype to add some additional logging, bind task metadata or include some config settings.)
691
+
- Handling other behavior that hooks into the registry lifecycle (see [gulp-hub](https://github.com/frankwallis/gulp-hub) for an example)
692
+
693
+
To build your own custom registry see the [undertaker documentation on custom registries](https://github.com/phated/undertaker#custom-registries).
694
+
695
+
#### registry
696
+
697
+
A registry instance or constructor. When passed in, the tasks from the current registry will be transferred to the new registry and then current registry will be replaced with the new registry.
698
+
699
+
#### Example
700
+
701
+
This example shows how to create and use a simple custom registry to add tasks.
702
+
703
+
```js
704
+
//gulpfile.js
705
+
var gulp =require('gulp');
706
+
707
+
var companyTasks =require('./myCompanyTasksRegistry.js');
0 commit comments