Skip to content

Commit 1f3ecd7

Browse files
Gregoryphated
authored andcommitted
Docs: Clarify incremental builds example (#1609)
1 parent 9f05491 commit 1f3ecd7

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,22 @@ export default build;
192192
You can filter out unchanged files between runs of a task using
193193
the `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+
195203
function 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

201209
function watch() {
202-
gulp.watch(paths.images, images);
210+
gulp.watch(paths.images.src, images);
203211
}
204212
```
205213
Task run times are saved in memory and are lost when gulp exits. It will only

0 commit comments

Comments
 (0)