This commit is contained in:
dlandy
2026-04-08 17:56:12 +08:00
parent 5a6328561f
commit e6c2d76238
41 changed files with 1361 additions and 335 deletions

View File

@@ -1,15 +1,20 @@
import { defineConfig } from 'vite';
import { defineConfig, loadEnv } from 'vite';
import vue from '@vitejs/plugin-vue';
export default defineConfig({
plugins: [vue()],
server: {
port: 5173,
proxy: {
'/api': {
target: 'http://localhost:3000',
changeOrigin: true,
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
const proxyTarget = env.VITE_API_PROXY_TARGET || 'http://localhost:3000';
return {
plugins: [vue()],
server: {
port: 5173,
proxy: {
'/api': {
target: proxyTarget,
changeOrigin: true,
},
},
},
},
});
};
});