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 Feb 1, 2024
1 parent 00b3876 commit 80aaf03
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
4 changes: 1 addition & 3 deletions scripts/build-front.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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-app

cd ..
rm -fr resources/webapp
Expand Down
27 changes: 17 additions & 10 deletions webapp/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 isDesktopAppMode = mode === "desktop-app";

return {
// When the web application is running in Desktop mode,
// the web app is served at the `/static` entry point
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 80aaf03

Please sign in to comment.