mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-03-16 18:33:08 +00:00
Replace the custom BOLD_REGEX parser in ChatMessage.tsx with react-markdown + remark-gfm for proper rendering of headers, tables, lists, code blocks, blockquotes, links, and horizontal rules in all chat UIs (AssistantChat, SpecCreationChat, ExpandProjectChat). Changes: - Add react-markdown and remark-gfm dependencies - Add vendor-markdown chunk to Vite manual chunks for code splitting - Add .chat-prose CSS class with styles for all markdown elements - Add .chat-prose-user modifier for contrast on primary-colored bubbles - Replace line-splitting + regex logic with ReactMarkdown component - Links open in new tabs via custom component override - System messages remain plain text (unchanged) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
66 lines
1.8 KiB
TypeScript
66 lines
1.8 KiB
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import path from 'path'
|
|
|
|
// Backend port - can be overridden via VITE_API_PORT env var
|
|
const apiPort = process.env.VITE_API_PORT || '8888'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react(), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
// React core
|
|
'vendor-react': ['react', 'react-dom'],
|
|
// Data fetching
|
|
'vendor-query': ['@tanstack/react-query'],
|
|
// Flow/graph visualization (largest dependency)
|
|
'vendor-flow': ['@xyflow/react', 'dagre'],
|
|
// Terminal emulator
|
|
'vendor-xterm': ['@xterm/xterm', '@xterm/addon-fit', '@xterm/addon-web-links'],
|
|
// UI components - Radix UI
|
|
'vendor-radix': [
|
|
'@radix-ui/react-checkbox',
|
|
'@radix-ui/react-dialog',
|
|
'@radix-ui/react-dropdown-menu',
|
|
'@radix-ui/react-label',
|
|
'@radix-ui/react-separator',
|
|
'@radix-ui/react-slot',
|
|
'@radix-ui/react-switch',
|
|
],
|
|
// Markdown rendering
|
|
'vendor-markdown': ['react-markdown', 'remark-gfm'],
|
|
// Icons and utilities
|
|
'vendor-utils': [
|
|
'lucide-react',
|
|
'canvas-confetti',
|
|
'class-variance-authority',
|
|
'clsx',
|
|
'tailwind-merge',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
server: {
|
|
proxy: {
|
|
'/api': {
|
|
target: `http://127.0.0.1:${apiPort}`,
|
|
changeOrigin: true,
|
|
},
|
|
'/ws': {
|
|
target: `ws://127.0.0.1:${apiPort}`,
|
|
ws: true,
|
|
},
|
|
},
|
|
},
|
|
})
|