Skip to content

Commit

Permalink
Merge pull request #1920 from AntaresSimulatorTeam/bugfix/desktop_bui…
Browse files Browse the repository at this point in the history
…ld_windows
  • Loading branch information
skamril authored Feb 1, 2024
2 parents 00b3876 + d256ad8 commit a2060ae
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 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

cd ..
rm -fr resources/webapp
Expand Down
2 changes: 0 additions & 2 deletions webapp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ dist-ssr
*.njsproj
*.sln
*.sw?
.env.*

32 changes: 22 additions & 10 deletions webapp/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
},
};
});

0 comments on commit a2060ae

Please sign in to comment.