Skip to content

Commit

Permalink
build: fix issue with desktop app packaging for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
skamril committed Jan 31, 2024
1 parent 60957a7 commit eba5bdf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- "master"
- "hotfix/**"
- "bugfix/desktop_build_windows"

jobs:
binary:
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-front.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 15 additions & 10 deletions webapp/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@ 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 isDesktopAppMode = mode === "desktop-app";

return {
base: isDesktopAppMode ? "/static/" : "/",
plugins: [react({ devTarget: "es2022" })],
server: {
port: 3000,
strictPort: true,
proxy: {
"/v1": SERVER_URL,
"/version": SERVER_URL,
"/ws": SERVER_URL,
},
},
},
};
});

0 comments on commit eba5bdf

Please sign in to comment.