Skip to content

Instantly share code, notes, and snippets.

@david-j-davis
Created April 17, 2017 22:40
Show Gist options
  • Select an option

  • Save david-j-davis/3eae8284cc667dd37e56c78c41cf7604 to your computer and use it in GitHub Desktop.

Select an option

Save david-j-davis/3eae8284cc667dd37e56c78c41cf7604 to your computer and use it in GitHub Desktop.

Revisions

  1. @david-james-davis david-james-davis created this gist Apr 17, 2017.
    18 changes: 18 additions & 0 deletions gulpfile.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    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/'));
    });