Files
Claude-Code-Workflow/ccw/frontend/vite.config.ts
catlog22 341331325c feat: Enhance A2UI with RadioGroup and Markdown support
- Added support for RadioGroup component in A2UI, allowing single selection from multiple options.
- Implemented Markdown parsing in A2UIPopupCard for better content rendering.
- Updated A2UIPopupCard to handle different question types and improved layout for multi-select and single-select questions.
- Introduced new utility functions for handling disabled items during installation.
- Enhanced installation process to restore previously disabled skills and commands.
- Updated notification store and related tests to accommodate new features.
- Adjusted Vite configuration for better development experience.
2026-02-04 13:45:47 +08:00

74 lines
2.0 KiB
TypeScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
import { fileURLToPath } from 'url'
// ES module equivalent of __dirname
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
// Get base path from environment variable
// Default to /react/ for development (CCW server proxies /react/* to Vite)
// Can be overridden by VITE_BASE_URL environment variable
const basePath = process.env.VITE_BASE_URL || '/react/'
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
base: basePath,
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
},
server: {
// Don't hardcode port - allow command line override
// strictPort: true ensures the specified port is used or fails
strictPort: true,
proxy: {
// Backend API proxy
'/api': {
target: 'http://localhost:3456',
changeOrigin: true,
},
// WebSocket proxy for real-time updates
'/ws': {
target: 'ws://localhost:3456',
ws: true,
},
// Docusaurus documentation site proxy
// Forwards /docs requests to Docusaurus dev server running on port 3001
'/docs': {
target: 'http://localhost:3001',
changeOrigin: true,
// Preserve /docs prefix to match Docusaurus baseUrl configuration
// Example: /docs/overview -> http://localhost:3001/docs/overview
},
},
},
build: {
outDir: 'dist',
sourcemap: true,
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: './src/test/setup.ts',
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: [
'node_modules/',
'src/test/',
'**/*.d.ts',
'**/*.config.*',
'**/mockData/*',
'src/main.tsx',
],
},
include: ['src/**/*.{test,spec}.{ts,tsx}'],
css: true,
},
})