From bdb537e06d499cc8b13285f0f50e5ba0b4a64473 Mon Sep 17 00:00:00 2001 From: codecalm Date: Mon, 2 Mar 2020 00:59:10 +0100 Subject: new icons --- gulpfile.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gulpfile.js') diff --git a/gulpfile.js b/gulpfile.js index a1a8c1e..beb3969 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -50,3 +50,21 @@ gulp.task('icons-sprite', function (cb) { cb(); }); }); + +gulp.task('optimize', function(){ + glob("_site/icons/*.svg", {}, function (er, files) { + + files.forEach(function (file, i) { + let svgFile = fs.readFileSync(file), + svgFileContent = svgFile.toString(); + + svgFileContent = svgFileContent + .replace(/><\/(polyline|line|rect|circle)>/, '/>') + .replace(/\n\n+/g, "\n"); + + fs.writeFileSync(file, svgFileContent); + }); + + cb(); + }); +}); -- cgit v1.2.1