Files
best-choice/client/vite.config.ts
T
Jurgis Sakalauskas b20ab30ece add shared
2025-10-14 09:14:01 +03:00

29 lines
688 B
TypeScript

import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'node:path';
export default defineConfig(({ mode }) => {
const rootDir = path.resolve(__dirname, '..');
const env = loadEnv(mode, rootDir, '');
const clientPort = Number(env.CLIENT_PORT) || 5173;
const proxyTarget = env.API_PROXY_TARGET || 'http://localhost:3000';
return {
plugins: [react()],
server: {
port: clientPort,
proxy: {
'/api': proxyTarget
},
fs: {
allow: [path.resolve(__dirname, '..')]
}
},
resolve: {
alias: {
'@shared': path.resolve(__dirname, '../shared')
}
}
};
});