33 lines
692 B
TypeScript
33 lines
692 B
TypeScript
import { defineConfig } from 'vite';
|
|
import vue from '@vitejs/plugin-vue';
|
|
import { fileURLToPath, URL } from 'node:url';
|
|
|
|
const API_TARGET = 'https://api.montime.ir';
|
|
|
|
export default defineConfig({
|
|
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,
|
|
},
|
|
},
|
|
},
|
|
});
|