R
R
ralo2016-11-22 19:22:52
gulp.js
ralo, 2016-11-22 19:22:52

Gulp spritesmith split into different .css and .jpg folders?

Please tell me how to specify different paths for the sprite itself and css styles! To put them in different folders
, here is this gulp plugin
https://www.npmjs.com/package/gulp.spritesmith

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2016-11-22
@ralo

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
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question