var gulp = require('gulp');
var spritesmith = require('gulp.spritesmith');
gulp.task('sprite', function () {
var spriteData = gulp.src('images/*.png').pipe(spritesmith({
imgName: 'sprite.png',
cssName: 'sprite.css'
}));
spriteData.css.pipe(gulp.dest('path/to/output/')); // CSS
return spriteData.img.pipe(gulp.dest('path/to/output/')); // IMG
});