| 26 | public scanner: IconUsageScanner | undefined |
| 27 | |
| 28 | getRuntimeCollections(runtimeOptions: NuxtIconRuntimeOptions): string[] { |
| 29 | const resolved = runtimeOptions.fallbackToApi |
| 30 | ? collectionNames |
| 31 | : typeof this.options.serverBundle === 'string' |
| 32 | ? collectionNames |
| 33 | : this.options.serverBundle |
| 34 | ? this.options.serverBundle.collections |
| 35 | ?.map(c => typeof c === 'string' ? c : c.prefix) || [] |
| 36 | : [] |
| 37 | |
| 38 | // Include custom collections prefixes |
| 39 | for (const collection of this.options.customCollections || []) { |
| 40 | if (collection.prefix && !resolved.includes(collection.prefix)) |
| 41 | resolved.push(collection.prefix) |
| 42 | } |
| 43 | |
| 44 | return resolved |
| 45 | } |
| 46 | |
| 47 | private _customCollections: IconifyJSON[] | Promise<IconifyJSON[]> | undefined |
| 48 | private _serverBundle: ResolvedServerBundleOptions | Promise<ResolvedServerBundleOptions> | undefined |