mirror of
https://github.com/sakaljurgis/best-choice.git
synced 2026-07-08 21:47:40 +00:00
initial setup
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user