| 123456789101112131415161718192021222324252627282930313233343536 |
- import path from 'path';
- import { defineConfig, loadEnv } from 'vite';
- import react from '@vitejs/plugin-react';
- import tailwindcss from '@tailwindcss/vite';
- export default defineConfig(({ mode }) => {
- const env = loadEnv(mode, '.', '');
- return {
- server: {
- port: Number(env.VITE_PORT) || 13001,
- host: env.VITE_HOST || '0.0.0.0',
- proxy: {
- '/api': {
- target: env.VITE_BACKEND_URL || 'http://localhost:3001',
- changeOrigin: true,
- },
- '/uploads': {
- target: env.VITE_BACKEND_URL || 'http://localhost:3001',
- changeOrigin: true,
- },
- },
- },
- plugins: [tailwindcss(), react()],
- define: {
- 'process.env.API_KEY': JSON.stringify(env.GEMINI_API_KEY),
- 'process.env.GEMINI_API_KEY': JSON.stringify(env.GEMINI_API_KEY)
- },
- resolve: {
- alias: {
- '@': path.resolve(__dirname, '.'),
- }
- },
- publicDir: 'public'
- };
- });
- // touch
|