Last active
March 29, 2016 19:19
-
-
Save TrySound/245d8ab7ba67b5112d17 to your computer and use it in GitHub Desktop.
SVG sprite example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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