2025-03-04 07:22:05 +08:00
|
|
|
import { defineConfig, loadEnv } from 'vite';
|
|
|
|
import react from '@vitejs/plugin-react';
|
2025-02-27 06:54:19 +08:00
|
|
|
|
|
|
|
// https://vite.dev/config/
|
2025-03-04 07:22:05 +08:00
|
|
|
export default defineConfig(({ mode }) => {
|
|
|
|
const env = loadEnv(mode, process.cwd());
|
|
|
|
|
|
|
|
return {
|
2025-04-12 00:27:30 +08:00
|
|
|
base: '/',
|
2025-03-04 07:22:05 +08:00
|
|
|
plugins: [react()],
|
|
|
|
build: {
|
2025-04-12 00:27:30 +08:00
|
|
|
outDir: 'dist',
|
2025-03-04 07:22:05 +08:00
|
|
|
},
|
|
|
|
server: {
|
|
|
|
port: env.VITE_PORT,
|
|
|
|
proxy: {
|
|
|
|
'/api': {
|
2025-04-12 00:27:30 +08:00
|
|
|
target: env.VITE_API_URL || 'http://81.69.223.133:8008',
|
2025-03-04 07:22:05 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
},
|
|
|
|
},
|
2025-04-12 00:27:30 +08:00
|
|
|
historyApiFallback: true,
|
2025-03-04 07:22:05 +08:00
|
|
|
},
|
|
|
|
};
|
|
|
|
});
|