Paweł Kuna
5 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
1 additions and
7 deletions
-
.build/optimize.mjs
-
packages/icons-sprite/build.mjs
-
packages/icons-webfont/.build/utilities.mjs
|
|
|
@ -1,6 +1,6 @@ |
|
|
|
import { globSync } from 'glob'; |
|
|
|
import { readFileSync, writeFileSync } from 'fs'; |
|
|
|
import { join, basename } from 'path'; |
|
|
|
import { join } from 'path'; |
|
|
|
import { pathToFileURL } from 'url'; |
|
|
|
import { optimizePath, removeClosePath, ICONS_SRC_DIR, iconTemplate, types } from './helpers.mjs'; |
|
|
|
|
|
|
|
@ -165,8 +165,6 @@ if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) |
|
|
|
const files = globSync(join(ICONS_SRC_DIR, type, '*.svg')); |
|
|
|
|
|
|
|
files.forEach(function (file) { |
|
|
|
console.log(`Optimize ${basename(file)}`); |
|
|
|
|
|
|
|
// Read files
|
|
|
|
let svgFile = readFileSync(file), |
|
|
|
svgFileContent = optimizeSvgContent(svgFile.toString(), type); |
|
|
|
|
|
|
|
@ -11,7 +11,6 @@ const buildSprite = () => { |
|
|
|
console.log(`Building ${type} sprite...`); |
|
|
|
|
|
|
|
iconsInCategory.forEach((icon) => { |
|
|
|
console.log(`Adding ${icon.name}...`); |
|
|
|
const svgFileContent = icon.content |
|
|
|
.replace(/<svg[^>]+>/g, '') |
|
|
|
.replace(/<\/svg>/g, '') |
|
|
|
|
|
|
|
@ -225,9 +225,6 @@ export async function processIcons( |
|
|
|
// File doesn't exist, will be created
|
|
|
|
} |
|
|
|
|
|
|
|
const logPrefix = strokeName ? `${strokeName}/${fileName}` : `${type}/${fileName}`; |
|
|
|
console.log(`Writing to ${logPrefix}`); |
|
|
|
|
|
|
|
// Process content if processing function is provided
|
|
|
|
if (processContentFn) { |
|
|
|
svgContent = processContentFn(svgContent); |
|
|
|
|