Created
December 15, 2016 01:39
-
-
Save andreasbotsikas/e4507b2313b4fcec0291ba1a8d66db06 to your computer and use it in GitHub Desktop.
Optimize images using node.js and smushit
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 characters
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')); | |
}); |
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 characters
@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