gulp.task('images', function() { return gulp.src('./screens/**/*.png') // Works correctly with or without my memo plugin when imagemin is removed. .pipe(memo('_memo/gulp-memo.json')) // Only moves a single file to dest unless this is commented out. .pipe(imagemin()) // Makes the file containing a single folder near the end of the stream (but curiously, not the last file in the stream) unless imagemin is removed. .pipe(gulp.dest('./cdn/img')); });