From 9fd78f6f043ad2b3c6d9de183406b260bf4e5f3e Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Thu, 24 Nov 2022 15:01:07 +0100 Subject: [PATCH] add baseurl in front of dynamic imports for icons --- .../src/core/stores/icon/icon.store.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/core/stores/icon/icon.store.ts b/src/Umbraco.Web.UI.Client/src/core/stores/icon/icon.store.ts index 5e75c4c305..33a5b79496 100644 --- a/src/Umbraco.Web.UI.Client/src/core/stores/icon/icon.store.ts +++ b/src/Umbraco.Web.UI.Client/src/core/stores/icon/icon.store.ts @@ -1,4 +1,5 @@ import { UUIIconRegistry } from '@umbraco-ui/uui'; +import { baseUrl } from '@umbraco-cms/utils'; import icons from '../../../../public-assets/icons/icons.json'; interface UmbIconDescriptor { @@ -13,6 +14,15 @@ interface UmbIconDescriptor { * @description - Icon Store. Provides icons from the icon manifest. Icons are loaded on demand. All icons are prefixed with 'umb:' */ export class UmbIconStore extends UUIIconRegistry { + + #baseValue: string; + + constructor() { + super(); + + this.#baseValue = baseUrl(); + } + /** * @param {string} iconName * @return {*} {boolean} @@ -24,7 +34,7 @@ export class UmbIconStore extends UUIIconRegistry { const icon = this.provideIcon(iconName); - import(/* @vite-ignore */ `${iconManifest.path}`).then((iconModule) => { + import(`${this.#baseValue}${iconManifest.path}`).then((iconModule) => { icon.svg = iconModule.default; });