From c08a8a4b405bce79678a1790546335504375d833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Sat, 15 Jun 2024 11:51:54 +0200 Subject: [PATCH] fix: Properly import material icons with vite MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- .../components/ncIconPicker/mixins/svgHelper.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/shared/components/ncIconPicker/mixins/svgHelper.js b/src/shared/components/ncIconPicker/mixins/svgHelper.js index 551f367dc..5f73f0a19 100644 --- a/src/shared/components/ncIconPicker/mixins/svgHelper.js +++ b/src/shared/components/ncIconPicker/mixins/svgHelper.js @@ -4,20 +4,12 @@ */ export default { methods: { - uriToSvg(dataUri) { - const pattern = /data:image\/svg\+xml;base64,/ - const strippedUri = dataUri.replace(pattern, '') - - return atob(strippedUri) - }, async getContextIcon(iconName) { const { default: icon } = await import( - /* webpackChunkName: 'material-icons' */ - /* webpackMode: 'lazy-once' */ - `MaterialIcons/${iconName}.svg` + `./../../../../../img/material/${iconName}.svg?raw` ) - return this.uriToSvg(icon).replaceAll(/#fff/g, 'currentColor') + return icon.replaceAll(/#fff/g, 'currentColor') }, }, }