How to use the gulp-imagemin.svgo function in gulp-imagemin

To help you get started, we’ve selected a few gulp-imagemin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github baonguyenyam / canhcam-cab / core / k-task / task / gulp / imagemin.js View on Github external
gulp.task('imagemin', () => {

        return gulp.src(path.join(target, '**/.{gif,png,jpg,jpeg,bmp,svg}'))
            .pipe(imagemin([
                imagemin.gifsicle({ interlaced: true }),
                imagemin.jpegtran({ progressive: true }),
                imagemin.optipng({ optimizationLevel: 7 }),
                imagemin.svgo({ plugins: [{ removeViewBox: true }] })
            ], {
                verbose: true
            }))
            // .pipe(plugins.changed(dest))
            .pipe(gulp.dest(dest));

    });
github colinrotherham / core / src / tasks / img / optimise.js View on Github external
export default (config, gulp) => {

  const options = config.options || [
    imagemin.gifsicle(),
    imagemin.jpegtran({
      progressive: true,
    }),
    imagemin.optipng(),
    imagemin.svgo({
      plugins: [{
        removeViewBox: false,
      }],
    }),
  ];

  return () => gulp.src(config.src, { dot: true })
    .pipe(imagemin(options))
    .pipe(gulp.dest(config.dest));
};
github atolye15 / web-starter-kit / gulp / tasks / images / optimize.js View on Github external
return function() {
    return gulp
      .src([`${configs.paths.src}/img/**/*`, `!${configs.paths.src}/img/{icons,icons/**}`])
      .pipe(plumber({ errorHandler: notify.onError('Hata: <%= error.message %>') }))
      .pipe(newer('.tmp/img'))
      .pipe(
        imagemin([
          imagemin.gifsicle({ interlaced: true }),
          imagemin.jpegtran({ progressive: true }),
          imagemin.optipng({ optimizationLevel: 5 }),
          imagemin.svgo({ plugins: [{ removeDimensions: true }] }),
        ]),
      )
      .pipe(gulp.dest('.tmp/img'));
  };
}
github maliMirkec / starter-project / _gulp / gfx.js View on Github external
gulp.task('gfx', () => gulp.src(`${global.config.root + global.config.gfx.src}**/*`)
  .pipe(imagemin([
    imagemin.gifsicle(global.config.gfx.gifsicleConfig),
    imageminMozjpeg(global.config.gfx.imageminMozjpegConfig),
    imageminPngquant(global.config.gfximageminPngquantConfig),
    imagemin.svgo(global.config.gfx.svgoConfig)
  ]))
  .pipe(gulp.dest(global.config.root + global.config.dest + global.config.gfx.dest)))
github luxplanjay / gulp-starter-kit / gulp / tasks / images.js View on Github external
const images = () => {
  return gulp
    .src(paths.src.images)
    .pipe(newer(paths.build.images))
    .pipe(
      mode.production(
        imagemin([
          imagemin.jpegtran(imageMinConfig.jpegtran),
          imagemin.optipng(imageMinConfig.optipng),
          imagemin.svgo(imageMinConfig.svgo),
        ]),
      ),
    )
    .pipe(size({ showFiles: true }))
    .pipe(gulp.dest(paths.build.images));
};
github maliMirkec / starter-project-cli / gulpfile.js / gfx.js View on Github external
function gfxStart () {
  return src(helpers.trim(`${helpers.source()}/${global.config.gfx.src}/**/*`))
    .pipe(imagemin([
      imagemin.gifsicle(gfxConfig.gifConfig),
      imageminMozjpeg(gfxConfig.jpegConfig),
      imageminPngquant(gfxConfig.pngConfig),
      imagemin.svgo(gfxConfig.svgConfig)
    ]))
    .pipe(dest(helpers.trim(`${helpers.dist()}/${global.config.gfx.dist}`)))
    .pipe(gulpif(global.config.sync.run, global.bs.stream()))
}
github chalkygames123 / front-end-template / gulpfile.js / tasks / images.js View on Github external
isDev,
        gulpChanged(
          path.join(config.get('distDir'), config.get('site.basePath'))
        )
      )
    )
    .pipe(
      gulpIf(
        !isDev,
        gulpImagemin([
          imageminPngquant(),
          imageminMozjpeg(),
          gulpImagemin.gifsicle({
            optimizationLevel: 3
          }),
          gulpImagemin.svgo({
            plugins: [
              { removeViewBox: false },
              { removeUnknownsAndDefaults: false },
              { removeUselessDefs: false },
              { cleanupIDs: false }
            ]
          })
        ])
      )
    )
    .pipe(detectConflict())
    .pipe(
      gulp.dest(path.join(config.get('distDir'), config.get('site.basePath')))
    )
    .pipe(gulpIf(isDev, common.server.stream()))
    .pipe(gulpIf(config.get('webp'), gulpFilter('**/*.+(png|jp?(e)g)')))
github atolye15 / web-starter-kit / gulp / tasks / images.js View on Github external
export function imagesOptimize() {
  return gulp
    .src([`${configs.paths.src}/img/**/*`, `!${configs.paths.src}/img/{icons,icons/**}`])
    .pipe(newer('.cache/img'))
    .pipe(
      imagemin([
        imagemin.gifsicle({ interlaced: true }),
        imageminMozjpeg({ progressive: true }),
        imageminPngquant({
          quality: [0.6, 0.8],
        }),
        imagemin.svgo({ plugins: [{ removeDimensions: true }] }),
      ]),
    )
    .pipe(gulp.dest('.cache/img'))
    .on('error', notifierErrorHandler);
}
github escueladigital / EDboilerplate / gulpfile.babel.js View on Github external
gulp.task('images-build', () => {
  gulp.src('./src/img/**/**')
    .pipe(imagemin([
      imagemin.gifsicle({interlaced: true}),
      imagemin.jpegtran({progressive: true}),
      imagemin.optipng({optimizationLevel: 5}),
      imagemin.svgo()
    ]))
    .pipe(gulp.dest('./public/assets/img'))
})

gulp-imagemin

Minify PNG, JPEG, GIF and SVG images

MIT
Latest version published 6 months ago

Package Health Score

66 / 100
Full package analysis