Skip to content

Instantly share code, notes, and snippets.

@markusvonplunkett
Created May 10, 2017 14:46
Show Gist options
  • Save markusvonplunkett/d700d6ca6ebf8e95d279b7528ad3e275 to your computer and use it in GitHub Desktop.
Save markusvonplunkett/d700d6ca6ebf8e95d279b7528ad3e275 to your computer and use it in GitHub Desktop.
svgstore
// Combines SVGs into a single file using SYMBOLS and then inserts it into templates/svg-icons.php
gulp.task('svgstore', function () {
var svgs;
svgs = gulp
.src(path.source+'/images/svg_icons/*.svg')
.pipe(rename({prefix: 'icon-'}))
// .pipe(function() {
// return gulpif(enabled.svgMinify, svgmin({}));
// })
.pipe(svgstore({ inlineSvg: true }));
function fileContents (filePath, file) {
return file.contents.toString();
}
return gulp
.src(path.source+'/images/svg_symbols/svg-icons.php')
.pipe(inject(svgs, { transform: fileContents }))
.pipe(gulp.dest('templates/'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment