all
This commit is contained in:
28
Downloads/Voltaserve/ui/vite.config.ts
Normal file
28
Downloads/Voltaserve/ui/vite.config.ts
Normal file
@ -0,0 +1,28 @@
|
||||
import react from '@vitejs/plugin-react'
|
||||
import { defineConfig, loadEnv } from 'vite'
|
||||
import svgr from 'vite-plugin-svgr'
|
||||
import tsconfigPaths from 'vite-tsconfig-paths'
|
||||
|
||||
const config = ({ mode }) => {
|
||||
process.env = Object.assign(process.env, loadEnv(mode, process.cwd(), ''))
|
||||
return defineConfig({
|
||||
plugins: [react(), tsconfigPaths(), svgr()],
|
||||
server: {
|
||||
port: 3000,
|
||||
proxy: {
|
||||
'/proxy/api/v1': {
|
||||
target: process.env.API_URL,
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/proxy\/api/, ''),
|
||||
},
|
||||
'/proxy/idp/v1': {
|
||||
target: process.env.IDP_URL,
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/proxy\/idp/, ''),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
export default config
|
Reference in New Issue
Block a user