diff options
author | codecalm <codecalm@gmail.com> | 2020-03-21 21:05:33 +0100 |
---|---|---|
committer | codecalm <codecalm@gmail.com> | 2020-03-21 21:05:33 +0100 |
commit | e58f56dadbacf2e10e93e90918c5e7be3855a674 (patch) | |
tree | b7f4b1be2846d6f38a8b4d0f77e6d6de8b86c464 /gulpfile.js | |
parent | v1.0.1 (diff) | |
download | tabler-icons-e58f56dadbacf2e10e93e90918c5e7be3855a674.tar.xz |
sprite-nostroke new file, version 1.0.2v1.0.2
Diffstat (limited to 'gulpfile.js')
-rw-r--r-- | gulpfile.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gulpfile.js b/gulpfile.js index 37f6b224..679c3efe 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -91,6 +91,7 @@ gulp.task('icons-sprite', function (cb) { let svg = `<svg xmlns="http://www.w3.org/2000/svg"><defs>${svgContent}</defs></svg>`; fs.writeFileSync('tabler-sprite.svg', svg); + fs.writeFileSync('tabler-sprite-nostroke.svg', svg.replace(/stroke-width="2"\s/g, '')); cb(); }); }); @@ -189,7 +190,7 @@ gulp.task('optimize', function (cb) { .replace(/><\/(polyline|line|rect|circle|path)>/g, '/>') .replace(/rx="([^"]+)"\s+ry="\1"/g, 'rx="$1"') .replace(/\s?\/>/g, ' />') - .replace(/\n\s*<(line|circle|path|polyline)/g, "\n <$1") + .replace(/\n\s*<(line|circle|path|polyline|rect)/g, "\n <$1") .replace(/polyline points="([0-9.]+)\s([0-9.]+)\s([0-9.]+)\s([0-9.]+)"/g, 'line x1="$1" y1="$2" x2="$3" y2="$4"') .replace(/a([0-9.]+)\s([0-9.]+)\s([0-9.]+)\s?([0-1])\s?([0-1])\s?(-?[0-9.]+)\s?(-?[0-9.]+)/g, 'a$1 $2 $3 $4 $5 $6 $7') .replace(/\n\n+/g, "\n"); @@ -204,7 +205,7 @@ gulp.task('optimize', function (cb) { gulp.task('build-zip', function(cb) { const version = p.version; - return gulp.src('{icons/**/*,icons-png/**/*,tabler-sprite.svg}') + return gulp.src('{icons/**/*,icons-png/**/*,tabler-sprite.svg,tabler-sprite-nostroke.svg}') .pipe(zip(`tabler-icons-${version}.zip`)) .pipe(gulp.dest('packages')) }); @@ -241,4 +242,4 @@ gulp.task('svg-to-png', gulp.series('build-jekyll', 'clean-png', async (cb) => { cb(); })); -gulp.task('build', gulp.series('build-jekyll', 'build-copy', 'build-zip')); +gulp.task('build', gulp.series('optimize', 'build-jekyll', 'build-copy', 'icons-sprite', 'icons-preview', 'build-zip')); |