Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 652 Bytes

including-or-excluding-certain-images.md

File metadata and controls

26 lines (19 loc) · 652 Bytes

Including / excluding certain images

Use gulp-filter;

var gulp = require('gulp');
var imageDataURI = require('gulp-image-data-uri');
var filter = require('gulp-filter');

gulp.task('prepare', function() {
    var pngFilter = filter('*.png');

    gulp.src('./images/*')
        .pipe(pngFilter)
        .pipe(imageDataURI())
        .pipe(gulp.dest('./css')) // put the CSS generated somewhere
        .pipe(pngFilter.restore())
        .pipe(gulp.dest('./dist')); // also put all of the images somewhere else
});

gulp.task('default', ['prepare']);

Back to readme