From 52977cdc7a745d3e7475c3486a616167bb5741d3 Mon Sep 17 00:00:00 2001 From: Samir Kamal <1954121+skamril@users.noreply.github.com> Date: Wed, 31 Jan 2024 16:47:07 +0100 Subject: [PATCH] build: fix issue with desktop app packaging for Windows --- .github/workflows/deploy.yml | 1 + scripts/build-front.sh | 2 +- webapp/package.json | 1 + webapp/vite.config.ts | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 09535d94b9..8e3962450e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,6 +5,7 @@ on: branches: - "master" - "hotfix/**" + - "bugfix/desktop_build_windows" jobs: binary: diff --git a/scripts/build-front.sh b/scripts/build-front.sh index 37a1b2a41f..8f48625758 100755 --- a/scripts/build-front.sh +++ b/scripts/build-front.sh @@ -8,7 +8,7 @@ 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-app cd .. rm -fr resources/webapp diff --git a/webapp/package.json b/webapp/package.json index c4ec8e33c1..8f576b42ae 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -5,6 +5,7 @@ "type": "module", "scripts": { "build": "tsc && vite build", + "buildDesktop": "set VITE_APP_BASE=/static/ && npm run build", "clean": "rm -rf dist node_modules/.vite", "dev": "vite", "lint": "tsc --noEmit && eslint . --ext ts,tsx --report-unused-disable-directives", diff --git a/webapp/vite.config.ts b/webapp/vite.config.ts index 1acfabe928..609f4556d5 100644 --- a/webapp/vite.config.ts +++ b/webapp/vite.config.ts @@ -5,6 +5,7 @@ const SERVER_URL = "http://localhost:8080"; // https://vitejs.dev/config/ export default defineConfig({ + base: process.env.VITE_BASE_URL || "/", plugins: [react({ devTarget: "es2022" })], server: { port: 3000,