aboutsummaryrefslogtreecommitdiff
path: root/gulpfile.js
diff options
context:
space:
mode:
authorcodecalm <codecalm@gmail.com>2020-03-02 00:59:10 +0100
committercodecalm <codecalm@gmail.com>2020-03-02 15:59:10 +0100
commitbdb537e06d499cc8b13285f0f50e5ba0b4a64473 (patch)
treea68549a64180e16ef9e1e477b3ff17556024b52d /gulpfile.js
parenticons small fix (diff)
downloadtabler-icons-bdb537e06d499cc8b13285f0f50e5ba0b4a64473.tar.xz
new icons
Diffstat (limited to 'gulpfile.js')
-rw-r--r--gulpfile.js18
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();
+ });
+});