Created
April 17, 2017 22:40
-
-
Save david-j-davis/3eae8284cc667dd37e56c78c41cf7604 to your computer and use it in GitHub Desktop.
Takes retina images and downsizes them inside to non-retina images in the same folder using gulp-retinize
This file contains 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 retinize = require('gulp-retinize'); | |
gulp.task('retiniizing', function(file) { | |
/* NOTE: Retinize accepts @4x and @2x resolutions, outputting to @4x, @2x, and @1x. | |
Overrides may be implemented by manually creating lower resolution copies in the source directory. */ | |
const retinizeOpts = { | |
// Your options here. | |
}; | |
console.log('Retinizing images...'); | |
return gulp.src(file && file.path || './path/to/your/sprites/*.{png,jpg,jpeg}') | |
.pipe(retinize(retinizeOpts)) | |
.on('error', function(e) { | |
console.log(e.message); | |
}) | |
.pipe(gulp.dest('./path/to/your/sprites/')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment