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: README.md
+79-12Lines changed: 79 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,37 @@ taskLoader({
48
48
49
49
These options would convert a filename such as `move-all.js` to a task with the name `move:all`.
50
50
51
+
### Plugins
52
+
53
+
##### Using gulp-load-plugins
54
+
55
+
You can use [gulp-load-plugins](https://www.npmjs.com/package/gulp-load-plugins) to easily lazy-load your gulp plugins. Use gulp-load-plugins in conjunction with gulp-simple-task-loader to minimize your gulpfile.
56
+
57
+
```js
58
+
'use strict';
59
+
60
+
var taskLoader =require('gulp-simple-task-loader');
61
+
var plugins =require('gulp-load-plugins')();
62
+
63
+
taskLoader({ plugins: plugins });
64
+
```
65
+
66
+
##### Passing in plugins manually
67
+
68
+
If not using gulp-load-plugins you must specify which plugins you want made available to your tasks.
69
+
70
+
```js
71
+
'use strict';
72
+
73
+
var taskLoader =require('gulp-simple-task-loader');
74
+
var plugins = {
75
+
bump:require('gulp-bump'),
76
+
mocha:require('gulp-mocha')
77
+
};
78
+
79
+
taskLoader({ plugins: plugins });
80
+
```
81
+
51
82
## Structuring a task
52
83
53
84
All tasks should be functions that receive the parameters `gulp`, `config`, and `plugins`.
Both `deps` and `fn` are optional. This allows you to create a task that strictly calls other tasks, or a task that doesn't have dependencies. If there are no dependencies for the task you can use the above format for creating a basic task.
You can use [gulp-load-plugins](https://www.npmjs.com/package/gulp-load-plugins) to easily lazy-load your gulp plugins. Use gulp-load-plugins in conjunction with gulp-simple-task-loader to minimize your gulpfile.
85
-
86
119
```js
120
+
(gulpfile.js)
121
+
122
+
'use strict';
123
+
87
124
var taskLoader =require('gulp-simple-task-loader');
88
-
var plugins =require('gulp-load-plugins')();
125
+
var plugins =require('gulp-load-plugins');
89
126
90
-
taskLoader({ plugins: plugins });
127
+
taskLoader({
128
+
filenameDelimiter:'-',
129
+
tasknameDelimiter:':',
130
+
plugins: plugins
131
+
});
91
132
```
92
133
93
-
### Passing in plugins manually
134
+
```js
135
+
(tasks/lint-all.js)
136
+
137
+
'use strict';
138
+
139
+
module.exports=function(gulp, config, plugins) {
140
+
return {
141
+
deps: [ 'lint:client', 'lint:server' ]
142
+
};
143
+
};
144
+
```
94
145
95
146
```js
96
-
var taskLoader =require('gulp-simple-task-loader');
0 commit comments