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 @@ -192,14 +192,22 @@ export default build;
192192You can filter out unchanged files between runs of a task using
193193the ` gulp.src ` function's ` since ` option and ` gulp.lastRun ` :
194194``` js
195+ const paths = {
196+ ...
197+ images: {
198+ src: ' src/images/**/*.{jpg,jpeg,png}' ,
199+ dest: ' build/img/'
200+ }
201+ }
202+
195203function images () {
196- return gulp .src (paths .images , {since: gulp .lastRun (' images' )})
204+ return gulp .src (paths .images . src , {since: gulp .lastRun (' images' )})
197205 .pipe (imagemin ({optimizationLevel: 5 }))
198- .pipe (gulp .dest (' build/img ' ));
206+ .pipe (gulp .dest (paths . images . dest ));
199207}
200208
201209function watch () {
202- gulp .watch (paths .images , images);
210+ gulp .watch (paths .images . src , images);
203211}
204212```
205213Task 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