Files
ace-step-ui/vite.config.ts
T
fspecii dade566647 Fix Windows IPv6 issue: use 127.0.0.1 instead of localhost in Vite proxy
On Windows, 'localhost' can resolve to IPv6 ::1 instead of IPv4
127.0.0.1, causing ECONNREFUSED when the Vite dev proxy tries to
reach the Express server. Using explicit 127.0.0.1 avoids this.

Fixes #12
2026-02-05 23:12:38 +02:00

45 lines
1.0 KiB
TypeScript

import path from 'path';
import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, '.', '');
return {
server: {
port: 3000,
host: '0.0.0.0',
proxy: {
'/api': {
target: 'http://127.0.0.1:3001',
changeOrigin: true,
},
'/audio': {
target: 'http://127.0.0.1:3001',
changeOrigin: true,
},
'/editor': {
target: 'http://127.0.0.1:3001',
changeOrigin: true,
},
'/blog': {
target: 'http://127.0.0.1:3001',
changeOrigin: true,
},
},
},
optimizeDeps: {
exclude: ['@ffmpeg/ffmpeg', '@ffmpeg/util'],
},
plugins: [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, '.'),
}
}
};
});