From c3dbc10afa7dcd8c86eebcd7f87967ac1f680da2 Mon Sep 17 00:00:00 2001 From: Gregory Date: Mon, 18 Apr 2016 19:54:56 -0400 Subject: [PATCH] Docs: Clarify incremental builds example (#1609) --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8f102d857..8b8ce9bc5 100644 --- a/README.md +++ b/README.md @@ -196,14 +196,22 @@ export default build; You can filter out unchanged files between runs of a task using the `gulp.src` function's `since` option and `gulp.lastRun`: ```js +const paths = { + ... + images: { + src: 'src/images/**/*.{jpg,jpeg,png}', + dest: 'build/img/' + } +} + function images() { - return gulp.src(paths.images, {since: gulp.lastRun('images')}) + return gulp.src(paths.images.src, {since: gulp.lastRun('images')}) .pipe(imagemin({optimizationLevel: 5})) - .pipe(gulp.dest('build/img')); + .pipe(gulp.dest(paths.images.dest)); } function watch() { - gulp.watch(paths.images, images); + gulp.watch(paths.images.src, images); } ``` Task run times are saved in memory and are lost when gulp exits. It will only