Skip to content

Commit 57a0ceb

Browse files
authored
fix: check if preset is in presetsCDN (#291)
avoid <url>/undefined head link fix #290
1 parent 681db4b commit 57a0ceb

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/icons.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ const presetsCDN = {
1010
export type IconPreset = keyof typeof presetsCDN
1111

1212
export default function setupIcons (this: ModuleThis, preset: IconPreset) {
13-
this.options.head!.link!.push({
14-
rel: 'stylesheet',
15-
type: 'text/css',
16-
href: presetsCDN[preset]
17-
})
13+
if (presetsCDN[preset]) {
14+
this.options.head!.link!.push({
15+
rel: 'stylesheet',
16+
type: 'text/css',
17+
href: presetsCDN[preset]
18+
})
19+
}
1820
}

0 commit comments

Comments
 (0)