| | |
| | | } |
| | | |
| | | function collectUsedIconsByPrefix() { |
| | | const iconPattern = /icon\s*[:=]\s*["']([a-z0-9-]+):([a-z0-9-]+)["']/g |
| | | const iconPattern = /["']([a-z0-9-]+):([a-z0-9-]+)["']/g |
| | | const knownPrefixes = new Set(Object.keys(iconCollections)) |
| | | const usedIconsByPrefix = new Map() |
| | | |
| | | for (const filePath of collectSourceFiles(srcRoot)) { |
| | | const content = fs.readFileSync(filePath, 'utf8') |
| | | |
| | | for (const [, prefix, name] of content.matchAll(iconPattern)) { |
| | | if (!knownPrefixes.has(prefix)) { |
| | | continue |
| | | } |
| | | |
| | | const names = usedIconsByPrefix.get(prefix) || new Set() |
| | | names.add(name) |
| | | usedIconsByPrefix.set(prefix, names) |