File tree 1 file changed +11
-3
lines changed
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -196,14 +196,22 @@ export default build;
196
196
You can filter out unchanged files between runs of a task using
197
197
the ` gulp.src ` function's ` since ` option and ` gulp.lastRun ` :
198
198
``` js
199
+ const paths = {
200
+ ...
201
+ images: {
202
+ src: ' src/images/**/*.{jpg,jpeg,png}' ,
203
+ dest: ' build/img/'
204
+ }
205
+ }
206
+
199
207
function images () {
200
- return gulp .src (paths .images , {since: gulp .lastRun (' images' )})
208
+ return gulp .src (paths .images . src , {since: gulp .lastRun (' images' )})
201
209
.pipe (imagemin ({optimizationLevel: 5 }))
202
- .pipe (gulp .dest (' build/img ' ));
210
+ .pipe (gulp .dest (paths . images . dest ));
203
211
}
204
212
205
213
function watch () {
206
- gulp .watch (paths .images , images);
214
+ gulp .watch (paths .images . src , images);
207
215
}
208
216
```
209
217
Task run times are saved in memory and are lost when gulp exits. It will only
You can’t perform that action at this time.
0 commit comments