Revert "[feat] improve custom icon build script with TypeScript and error handling (#5202)"

This reverts commit 7d6e252814.
This commit is contained in:
Benjamin Lu
2025-08-26 15:26:00 -04:00
parent 74b61ecfdf
commit 641e9f28bb
6 changed files with 34 additions and 125 deletions

View File

@@ -0,0 +1,29 @@
import { readFileSync, readdirSync } from 'fs'
import { join } from 'path'
import { dirname } from 'path'
import { fileURLToPath } from 'url'
const fileName = fileURLToPath(import.meta.url)
const dirName = dirname(fileName)
const customIconsPath = join(dirName, '..', 'src', 'assets', 'icons', 'custom')
// Create an Iconify collection for custom icons
export const iconCollection = {
prefix: 'comfy',
icons: {},
width: 16,
height: 16
}
// Read all SVG files from the custom icons directory
const files = readdirSync(customIconsPath)
files.forEach((file) => {
if (file.endsWith('.svg')) {
const name = file.replace('.svg', '')
const content = readFileSync(join(customIconsPath, file), 'utf-8')
iconCollection.icons[name] = {
body: content
}
}
})