Skip to content

Instantly share code, notes, and snippets.

@TrySound
Last active March 29, 2016 19:19
Show Gist options
  • Save TrySound/245d8ab7ba67b5112d17 to your computer and use it in GitHub Desktop.
Save TrySound/245d8ab7ba67b5112d17 to your computer and use it in GitHub Desktop.
SVG sprite example
gulp.task('sprite', function (done) {
return gulp.src('app/sprite/**/[^_]*.svg')
.pipe(rename({prefix: 'shape-'}))
.pipe(svgmin())
.on('error', done)
.pipe(svgstore({
inlineSvg: true
}))
.on('error', done)
.pipe(svgmin({
js2svg: {
pretty: true,
indent: ' '
},
plugins: [{
cleanupIDs: false
}]
}))
.on('error', done)
.pipe(rename('sprite.svg'))
.pipe(gulp.dest('public/img'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment