diff options
author | codecalm <codecalm@gmail.com> | 2020-03-02 00:59:10 +0100 |
---|---|---|
committer | codecalm <codecalm@gmail.com> | 2020-03-02 15:59:10 +0100 |
commit | bdb537e06d499cc8b13285f0f50e5ba0b4a64473 (patch) | |
tree | a68549a64180e16ef9e1e477b3ff17556024b52d /gulpfile.js | |
parent | icons small fix (diff) | |
download | tabler-icons-bdb537e06d499cc8b13285f0f50e5ba0b4a64473.tar.xz |
new icons
Diffstat (limited to 'gulpfile.js')
-rw-r--r-- | gulpfile.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gulpfile.js b/gulpfile.js index a1a8c1e3..beb3969d 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(); + }); +}); |