23 lines
541 B
TypeScript
23 lines
541 B
TypeScript
import path from 'path';
|
|
import { defineConfig, loadEnv } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import autoprefixer from 'autoprefixer';
|
|
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, process.cwd(), '');
|
|
const API_URL = env.VITE_API_URL || 'http://localhost:5050';
|
|
|
|
return {
|
|
plugins: [tailwindcss(), react()],
|
|
server: {
|
|
proxy: {
|
|
'/api': {
|
|
target: API_URL,
|
|
changeOrigin: true,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}); |