Reputation: 10101
I've folder structure as
assets/images/foo/abc.jpg
assets/images/bar/def.jpg
..
I want to imagemin them and place the images in the same sub folders, with gulp, how to do?
var paths = {
images: 'assets/images/**/*'
};
gulp.task('images', function () {
return gulp.src(paths.images)
.pipe(imagemin({optimizationLevel: 5}))
.pipe(gulp.dest(???));
});
What should I put in the gulp.dest
?
Upvotes: 1
Views: 1789
Reputation: 10167
Have a look at this future recipe :
If you want to maintain the structure, you need to pass {base: '.'} to gulp.src().
Upvotes: 2