I'm using gulp-imagemin
in it's basic form
gulp.task('image', function() {
return gulp.src('./images/*')
.pipe(imagemin({
progressive: true,
svgoPlugins: [{removeViewBox: false}],
use: [pngquant()]
}))
.pipe(gulp.dest('./build/'));
});
My images/
directory looks like
images/
logo.png
subfolder/
image.png
I would like them to output as such:
build/
logo.png
image.png
But they are retaining their folder structure.
How can this be achieved?