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/.gitignore b/webapp/.gitignore index d1ee0fabf3..3b3f257e44 100644 --- a/webapp/.gitignore +++ b/webapp/.gitignore @@ -19,5 +19,3 @@ dist-ssr *.njsproj *.sln *.sw? -.env.* - diff --git a/webapp/vite.config.ts b/webapp/vite.config.ts index 1acfabe928..51f9500a18 100644 --- a/webapp/vite.config.ts +++ b/webapp/vite.config.ts @@ -4,15 +4,27 @@ 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: { + // Main API URLs + "/v1": SERVER_URL, + // Core API URLs + "/health": SERVER_URL, + "/kill": SERVER_URL, + "/version": SERVER_URL, + // WebSocket + "/ws": SERVER_URL, + }, }, - }, + }; });