From 90711a6fbfd3ab247304ddc2191650de9374da9c Mon Sep 17 00:00:00 2001 From: Samir Kamal <1954121+skamril@users.noreply.github.com> Date: Thu, 1 Feb 2024 10:15:22 +0100 Subject: [PATCH 1/3] build: fix issue with desktop app packaging for Windows --- scripts/build-front.sh | 4 +--- webapp/vite.config.ts | 27 +++++++++++++++++---------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/scripts/build-front.sh b/scripts/build-front.sh index 37a1b2a41f..87c2db6a50 100755 --- a/scripts/build-front.sh +++ b/scripts/build-front.sh @@ -6,9 +6,7 @@ CURR_DIR=$(cd "$(dirname "$0")" && pwd) cd "$CURR_DIR"/../webapp -# When the web application is running in Desktop mode, -# the web app is served at the `/static` entry point. -npm run build -- --base=/static/ +npm run build -- --mode=desktop cd .. rm -fr resources/webapp diff --git a/webapp/vite.config.ts b/webapp/vite.config.ts index 1acfabe928..5b7248a161 100644 --- a/webapp/vite.config.ts +++ b/webapp/vite.config.ts @@ -4,15 +4,22 @@ import react from "@vitejs/plugin-react-swc"; const SERVER_URL = "http://localhost:8080"; // https://vitejs.dev/config/ -export default defineConfig({ - plugins: [react({ devTarget: "es2022" })], - server: { - port: 3000, - strictPort: true, - proxy: { - "/v1": SERVER_URL, - "/version": SERVER_URL, - "/ws": SERVER_URL, +export default defineConfig(({ mode }) => { + const isDesktopMode = mode === "desktop"; + + return { + // When the web application is running in Desktop mode, + // the web app is served at the `/static` entry point + base: isDesktopMode ? "/static/" : "/", + plugins: [react({ devTarget: "es2022" })], + server: { + port: 3000, + strictPort: true, + proxy: { + "/v1": SERVER_URL, + "/version": SERVER_URL, + "/ws": SERVER_URL, + }, }, - }, + }; }); From fa37287ef77ca42a36a2845dd6bf9c1b7251fec1 Mon Sep 17 00:00:00 2001 From: Samir Kamal <1954121+skamril@users.noreply.github.com> Date: Thu, 1 Feb 2024 10:51:29 +0100 Subject: [PATCH 2/3] build(vite): update proxy config add `/healt` and `/kill` entry points --- webapp/vite.config.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webapp/vite.config.ts b/webapp/vite.config.ts index 5b7248a161..51f9500a18 100644 --- a/webapp/vite.config.ts +++ b/webapp/vite.config.ts @@ -16,8 +16,13 @@ export default defineConfig(({ mode }) => { port: 3000, strictPort: true, proxy: { + // Main API URLs "/v1": SERVER_URL, + // Core API URLs + "/health": SERVER_URL, + "/kill": SERVER_URL, "/version": SERVER_URL, + // WebSocket "/ws": SERVER_URL, }, }, From d256ad8234027f201c935668051eef340a24c445 Mon Sep 17 00:00:00 2001 From: Samir Kamal <1954121+skamril@users.noreply.github.com> Date: Wed, 31 Jan 2024 18:47:52 +0100 Subject: [PATCH 3/3] chore: update .gitignore only `.env.*.local` files have to be ignored --- webapp/.gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/webapp/.gitignore b/webapp/.gitignore index d1ee0fabf3..3b3f257e44 100644 --- a/webapp/.gitignore +++ b/webapp/.gitignore @@ -19,5 +19,3 @@ dist-ssr *.njsproj *.sln *.sw? -.env.* -