Skip to content

Commit

Permalink
feat(ui): handle env file for dev
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Apr 30, 2024
1 parent e5ae293 commit 4e1122c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions client/vite.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { defineConfig } from 'vite';
import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';

export default defineConfig(() => {
export default defineConfig(({ command, mode }) => {
const env = loadEnv(mode, process.cwd(), '')

return {
base: '/ui',
build: {
Expand Down Expand Up @@ -34,16 +36,16 @@ export default defineConfig(() => {
open: true,
proxy: {
'/api': {
target: 'http://localhost:8080'
target: env.APP_BASE_URL || 'http://localhost:8080'
},
'/login': {
target: 'http://localhost:8080'
target: env.APP_BASE_URL || 'http://localhost:8080'
},
'/logout': {
target: 'http://localhost:8080'
target: env.APP_BASE_URL || 'http://localhost:8080'
},
'/oauth': {
target: 'http://localhost:8080'
target: env.APP_BASE_URL || 'http://localhost:8080'
}
}
},
Expand Down

0 comments on commit 4e1122c

Please sign in to comment.