From c46c4331111e85871a3370900ea157f409277d34 Mon Sep 17 00:00:00 2001 From: David Ralph Date: Fri, 17 May 2024 22:48:50 +0100 Subject: [PATCH] fix: img assets on build (hopefully temp) --- src/features/misc/sections/About.jsx | 8 +++----- vite.config.mjs | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/features/misc/sections/About.jsx b/src/features/misc/sections/About.jsx index cc19851a..d423b5dc 100644 --- a/src/features/misc/sections/About.jsx +++ b/src/features/misc/sections/About.jsx @@ -17,10 +17,7 @@ class About extends PureComponent { other_contributors: [], photographers: [], update: variables.getMessage('modals.main.settings.sections.about.version.checking_update'), - loading: variables.getMessage('modals.main.loading'), - image: document.body.classList.contains('dark') - ? 'src/assets/icons/mue_about.png' - : 'src/assets/icons/mue_about.png', + loading: variables.getMessage('modals.main.loading') }; this.controller = new AbortController(); } @@ -125,11 +122,12 @@ class About extends PureComponent { } render() { + const MUE_LOGO = new URL('/src/assets/icons/mue.svg', import.meta.url).href; return ( <>
- Logo + Logo
Mue, by Kaiso diff --git a/vite.config.mjs b/vite.config.mjs index 385c7844..9671cbc0 100644 --- a/vite.config.mjs +++ b/vite.config.mjs @@ -43,6 +43,14 @@ const prepareBuilds = () => ({ recursive: true, }, ); + fs.mkdirSync(path.resolve(__dirname, './build/chrome/src/assets'), { recursive: true }); + fs.cpSync( + path.resolve(__dirname, './src/assets'), + path.resolve(__dirname, './build/chrome/src/assets'), + { + recursive: true, + }, + ); // firefox fs.mkdirSync(path.resolve(__dirname, './build/firefox'), { recursive: true }); @@ -64,6 +72,13 @@ const prepareBuilds = () => ({ recursive: true, }, ); + fs.cpSync( + path.resolve(__dirname, './src/assets'), + path.resolve(__dirname, './build/firefox/src/assets'), + { + recursive: true, + }, + ); // create zip const zip = new ADMZip();