| | |
| | | } |
| | | |
| | | function collectIconPrefixes() { |
| | | const iconPattern = /icon\s*[:=]\s*["']([a-z0-9-]+):/g |
| | | const iconPattern = /["']([a-z0-9-]+):([a-z0-9-]+)["']/g |
| | | const knownPrefixes = new Set([ |
| | | 'fluent', |
| | | 'icon-park-outline', |
| | | 'iconamoon', |
| | | 'ix', |
| | | 'line-md', |
| | | 'ri', |
| | | 'svg-spinners', |
| | | 'system-uicons', |
| | | 'vaadin' |
| | | ]) |
| | | const prefixes = new Set() |
| | | |
| | | for (const filePath of collectSourceFiles(srcRoot)) { |
| | | const content = fs.readFileSync(filePath, 'utf8') |
| | | |
| | | for (const match of content.matchAll(iconPattern)) { |
| | | prefixes.add(match[1]) |
| | | for (const [, prefix] of content.matchAll(iconPattern)) { |
| | | if (!knownPrefixes.has(prefix)) { |
| | | continue |
| | | } |
| | | |
| | | prefixes.add(prefix) |
| | | } |
| | | } |
| | | |