File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -196,14 +196,22 @@ export default build;
196196You can filter out unchanged files between runs of a task using
197197the ` gulp.src ` function's ` since ` option and ` gulp.lastRun ` :
198198``` js
199+ const paths = {
200+ ...
201+ images: {
202+ src: ' src/images/**/*.{jpg,jpeg,png}' ,
203+ dest: ' build/img/'
204+ }
205+ }
206+
199207function images () {
200- return gulp .src (paths .images , {since: gulp .lastRun (' images' )})
208+ return gulp .src (paths .images . src , {since: gulp .lastRun (' images' )})
201209 .pipe (imagemin ({optimizationLevel: 5 }))
202- .pipe (gulp .dest (' build/img ' ));
210+ .pipe (gulp .dest (paths . images . dest ));
203211}
204212
205213function watch () {
206- gulp .watch (paths .images , images);
214+ gulp .watch (paths .images . src , images);
207215}
208216```
209217Task 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