W
W
wakenbyWork2021-11-22 19:47:05
gulp.js
wakenbyWork, 2021-11-22 19:47:05

Why does gulp-imagemin increase photo weight?

Here is the task:

const { src, dest } = require('gulp')
const imagemin = require('gulp-imagemin')

const imageminPlugins = [
  imagemin.gifsicle({
    optimisationLevel: 3
  }),
  imagemin.optipng({
    optimizationLevel: 3
  }),
  imagemin.mozjpeg({
    progressive: true,
    quality: 100
  }),
  imagemin.svgo({
    plugins: [
      { removeViewBox: false },
      { removeUnusedNS: false },
      { removeUselessStrokeAndFill: false },
      { cleanupIDs: false },
      { removeComments: true },
      { removeEmptyAttrs: true },
      { removeEmptyText: true },
      { collapseGroups: true }
    ]
  })
]

module.exports = function images () {
  return src('./src/assets/images/**/*')
    .pipe(imagemin(imageminPlugins))
    .pipe(dest('./dist/assets/images'))
}


There are two photos, one is optimized well, therefore it weighs less after processing. The second, on the contrary, begins to weigh more. There are photos that are starting to weigh twice as much. Also, the console displays the fact that one photo was processed, but in fact there are two of them, one of which starts to weigh more ((

Someone came across this?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question