Akuria
5 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
13 additions and
0 deletions
-
.changeset/small-moons-hunt.md
-
packages/icons/src/svg/load.ts
|
|
@ -0,0 +1,5 @@ |
|
|
|
|
|
--- |
|
|
|
|
|
"@vben/icons": patch |
|
|
|
|
|
--- |
|
|
|
|
|
|
|
|
|
|
|
fix: guard svg icon loading during docs SSR |
|
|
@ -53,6 +53,14 @@ function parseSvg(svgData: string): IconifyIconStructure { |
|
|
* <Icon icon="svg:avatar"></Icon> |
|
|
* <Icon icon="svg:avatar"></Icon> |
|
|
*/ |
|
|
*/ |
|
|
async function loadSvgIcons() { |
|
|
async function loadSvgIcons() { |
|
|
|
|
|
if ( |
|
|
|
|
|
typeof DOMParser === 'undefined' || |
|
|
|
|
|
typeof Node === 'undefined' || |
|
|
|
|
|
typeof XMLSerializer === 'undefined' |
|
|
|
|
|
) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const svgEagers = import.meta.glob('./icons/**', { |
|
|
const svgEagers = import.meta.glob('./icons/**', { |
|
|
eager: true, |
|
|
eager: true, |
|
|
query: '?raw', |
|
|
query: '?raw', |
|
|
|