Created
July 18, 2018 14:36
-
-
Save shelldandy/75fb7d2c667ec1af9cbc2d1fe97bdb56 to your computer and use it in GitHub Desktop.
Revisions
-
shelldandy renamed this gist
Jul 18, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
shelldandy created this gist
Jul 18, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ const gulp = require('gulp') const imagemin = require('gulp-imagemin') const imageminPngquant = require('imagemin-pngquant'); const imageminZopfli = require('imagemin-zopfli'); const imageminMozjpeg = require('imagemin-mozjpeg'); // need to run 'brew install libpng' const imageminGiflossy = require('imagemin-giflossy'); gulp.task('esketit', () => gulp.src(['src/**/*.{gif,png,jpg,jpeg,svg}']) .pipe(imagemin([ // png imageminPngquant({ speed: 1, quality: 98 // lossy settings }), imageminZopfli({ more: true }), imageminGiflossy({ optimizationLevel: 3, optimize: 3, // keep-empty: Preserve empty transparent frames lossy: 2 }), // svg // copied these values from the sketch svgo plugin imagemin.svgo({ plugins: [ { cleanupListOfValues: true }, { sortAttrs: true } ] }), // jpg lossless imagemin.jpegtran({ progressive: true }), // jpg very light lossy, use vs jpegtran imageminMozjpeg({ quality: 90 }) ])) .pipe(gulp.dest('dist')) );