Files
2026-06-13 12:38:47 +03:30

36 lines
855 B
TypeScript

import { defineConfig, loadEnv } from 'vite';
import vue from '@vitejs/plugin-vue';
import { fileURLToPath, URL } from 'node:url';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
const API_TARGET = env.VITE_DEV_API_PROXY || 'https://api.montime.ir';
return {
plugins: [vue()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
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,
},
},
},
};
});