1. add proxy config for summary API in vite config and nginx 2. implement SSE streaming parsing and text extraction utilities 3. add real-time summary component with typing animation and copy function
34 lines
795 B
TypeScript
34 lines
795 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import { resolve } from 'path'
|
|
|
|
export default defineConfig({
|
|
base: '/sidebar/',
|
|
plugins: [react()],
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:8080',
|
|
changeOrigin: true
|
|
},
|
|
'/sidebar/summary-api': {
|
|
target: 'http://8.159.132.53:8000',
|
|
changeOrigin: true,
|
|
rewrite: (p) => p.replace(/^\/sidebar\/summary-api/, '/api/summary')
|
|
}
|
|
}
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
sourcemap: true,
|
|
rollupOptions: {
|
|
input: {
|
|
index: resolve(__dirname, 'index.html'),
|
|
summary: resolve(__dirname, 'summary.html'),
|
|
'summary-search': resolve(__dirname, 'summary-search.html')
|
|
}
|
|
}
|
|
}
|
|
})
|