Fix frontend entrypoint for Vite build

This commit is contained in:
Koha9
2025-11-29 00:25:45 +09:00
parent e5ba790b44
commit 832dbc11d5
21 changed files with 3817 additions and 11 deletions
+30
View File
@@ -0,0 +1,30 @@
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: env.VITE_API_BASE_URL || 'http://localhost:8000',
changeOrigin: true,
rewrite: (path) => path,
},
},
},
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, '.'),
}
}
};
});