init website
This commit is contained in:
30
src/main/webapp/vite.config.js
Normal file
30
src/main/webapp/vite.config.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import {defineConfig, loadEnv} from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default ({mode}) => {
|
||||
process.env = {...process.env, ...loadEnv(mode, process.cwd())};
|
||||
|
||||
return defineConfig({
|
||||
plugins: [react()],
|
||||
server: {
|
||||
host: process.env.VITE_INT_HOST,
|
||||
port: process.env.VITE_INT_PORT,
|
||||
proxy: {
|
||||
// $VITE_URL/api* -> $VITE_API_URL/api*
|
||||
"/api": {
|
||||
target: process.env.VITE_API_URL,
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, ""),
|
||||
},
|
||||
// $VITE_URL/auth-api* -> $VITE_AUTH_URL*
|
||||
"^/auth-api": {
|
||||
target: process.env.VITE_AUTH_URL,
|
||||
changeOrigin: true,
|
||||
secure: true,
|
||||
rewrite: (path) => path.replace(/^\/auth-api/, ""),
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user