38 lines
1.3 KiB
TypeScript
Executable file
38 lines
1.3 KiB
TypeScript
Executable file
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import path from 'path';
|
|
import { versionPlugin } from '../../../@packages/@utils/vite-version-plugin/src';
|
|
import { dependencyStartupPlugin } from '@lilith/vite-plugin-dependency-startup';
|
|
import { platformVite } from '@lilith/build-core';
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
dependencyStartupPlugin({ feature: 'conversation-assistant' }),
|
|
react(),
|
|
platformVite({ allowedHosts: ['.local'] }),
|
|
versionPlugin({ appName: 'Conversation Assistant Dev' }),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
server: {
|
|
// Port from infrastructure/ports.yaml: features.conversation-assistant.frontend-dev
|
|
port: parseInt(process.env.VITE_PORT || '5173', 10),
|
|
host: true, // Allow external connections (needed for Docker)
|
|
proxy: {
|
|
'/api': {
|
|
// Port from infrastructure/ports.yaml: features.conversation-assistant.api
|
|
target: process.env.VITE_API_URL || 'http://localhost:3100',
|
|
changeOrigin: true,
|
|
},
|
|
'/ml': {
|
|
// Port from infrastructure/ports.yaml: ml.conversation-ml
|
|
target: process.env.VITE_ML_URL || 'http://localhost:8100',
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/ml/, ''),
|
|
},
|
|
},
|
|
},
|
|
});
|