Skip to content

Commit c3dbc10

Browse files
Gregoryphated
Gregory
authored andcommitted
Docs: Clarify incremental builds example (#1609)
1 parent 1351fb8 commit c3dbc10

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Diff for: README.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,22 @@ export default build;
196196
You can filter out unchanged files between runs of a task using
197197
the `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+
199207
function 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

205213
function watch() {
206-
gulp.watch(paths.images, images);
214+
gulp.watch(paths.images.src, images);
207215
}
208216
```
209217
Task run times are saved in memory and are lost when gulp exits. It will only

0 commit comments

Comments
 (0)