Files
webMontime/vite.config.ts
T

36 lines
855 B
TypeScript
Raw Normal View History

2026-06-13 12:38:47 +03:30
import { defineConfig, loadEnv } from 'vite';
2026-05-18 16:02:43 +03:30
import vue from '@vitejs/plugin-vue';
import { fileURLToPath, URL } from 'node:url';
2026-06-13 12:38:47 +03:30
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
const API_TARGET = env.VITE_DEV_API_PROXY || 'https://api.montime.ir';
2026-06-13 12:38:47 +03:30
return {
plugins: [vue()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
2026-06-13 12:38:47 +03:30
server: {
port: 5173,
proxy: {
'/api': {
target: API_TARGET,
changeOrigin: true,
secure: false,
timeout: 30_000,
rewrite: (path) => path.replace(/^\/api/, ''),
},
'/uploads': {
target: API_TARGET,
changeOrigin: true,
secure: false,
timeout: 30_000,
},
},
},
};
2026-05-18 21:30:37 +03:30
});