0

I'm running image optimization via Gulp which taking about a minute to optimize all my images. So can I show a progress bar in CLI so that It displays a progress bar while the image optimization task is running.

here is my code for gulp (which does image optimization)

// compresss image
gulp.task('compress-img', function() {
  gulp.src('src/images/*')
  timer
  .pipe(imagemin([
    imagemin.gifsicle({interlaced: true}),
    imagemin.jpegtran({progressive: true}),
    imagemin.optipng({optimizationLevel: 5}),
    imagemin.svgo({
      plugins: [
        {removeViewBox: true},
        {cleanupIDs: false}
      ] 
    })
  ]))
  .pipe(gulp.dest('dist/images'));
});
4

1 回答 1

0

您可能会发现这些 npm 包对实现进度条很有用:

于 2018-06-21T19:18:35.023 回答