Skip to content

Commit

Permalink
fix(client-bundle): use addIcon instead of addCollection
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Nov 10, 2024
1 parent 9b37e24 commit fd46c6e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/bundle-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,16 @@ export function registerClientBundle(
const collectionsRaw = `JSON.parse(${JSON.stringify(valuesCompat)})`

return [
'import { addCollection } from "@iconify/vue"',
'import { addIcon } from "@iconify/vue"',
'let _initialized = false',
'export function init() {',
' if (_initialized)',
' return',
` const collections = ${collectionsRaw}`,
` for (const collection of collections) {`,
' addCollection(collection)',
` for (const [name, data] of Object.entries(collection.icons)) {`,
` addIcon(collection.prefix + ':' + name, data)`,
` }`,
' }',
' _initialized = true',
'}',
Expand Down

0 comments on commit fd46c6e

Please sign in to comment.