Skip to content

Instantly share code, notes, and snippets.

@andreasbotsikas
Created December 15, 2016 01:39
Show Gist options
  • Save andreasbotsikas/e4507b2313b4fcec0291ba1a8d66db06 to your computer and use it in GitHub Desktop.
Save andreasbotsikas/e4507b2313b4fcec0291ba1a8d66db06 to your computer and use it in GitHub Desktop.
Optimize images using node.js and smushit
var gulp = require('gulp');
var smushit = require('gulp-smushit');
// Original images are located at images_orig and the destination folder is images
gulp.task('default', function () {
return gulp.src('images_orig/**/*.{jpg,png}')
.pipe(smushit())
.pipe(gulp.dest('images'));
});
@REM Note that it doesn't like spaces in the names
npm install --global gulp-cli
npm install gulp-smushit
gulp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment