chuhai-payment-frontend/vite.config.ts
2024-05-25 17:57:23 +08:00

30 lines
809 B
TypeScript

import {defineConfig} from 'vite'
import react from '@vitejs/plugin-react'
import {resolve} from "path";
// https://vitejs.dev/config/
export default defineConfig(({mode}) => {
return {
plugins: [react()],
base: mode == 'test' ? './' : '/',
define: {
APP_DEFAULT_PATH: JSON.stringify('/'),
APP_SITE_URL: JSON.stringify(process.env.VITE_APP_SITE_URL)
},
resolve: {
alias: {
'@': resolve(__dirname, './src')
}
},
server:{
proxy:{
'/api': {
target: 'http://43.136.175.109:50000',
changeOrigin: true,
//rewrite: (path) => path.replace(/^\/api/, '')
}
}
}
}
})