-
-
Save EdPoole/f51f2e39b83ac4ef881c to your computer and use it in GitHub Desktop.
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
var cheerio = require('gulp-cheerio'); | |
var svgmin = require('gulp-svgmin'); | |
var svgstore = require('gulp-svgstore'); | |
gulp.task('svgstore', function () { | |
return gulp | |
.src('assets/icons/*.svg') | |
.pipe(svgmin()) | |
.pipe(svgstore({ fileName: 'icons.svg', prefix: 'icon-' })) | |
.pipe(cheerio({ | |
run: function ($) { | |
$('[fill]').removeAttr('fill'); | |
$('symbol').attr('fill','currentColor'); | |
}, | |
parserOptions: { xmlMode: true } | |
})) | |
.pipe(gulp.dest('assets/')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment