gulp-imagemin npm package of node.js


Overview

This is a plugin for gulp which is used to minify the .jpeg, .png, .svg and gif files.

Code


													
var gulp = require('gulp');
var imagemin = require('gulp-imagemin');


gulp.task('default', () =>
    gulp.src('source/img/*')
        .pipe(imagemin())
        .pipe(gulp.dest('dist/images'))
);	
													
												

Run

  • Now run the snippet using the following command :
    													
    $gulp