mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-15 02:42:45 +08:00
- Remove docs-frontend.ts utility and docs proxy from server.ts - Remove docs startup logic from serve.ts - Delete HelpPage.tsx and /help route from frontend - Remove help navigation entry from Sidebar.tsx - Clean /docs proxy from vite.config.ts - Remove docs-related scripts from package.json files - Delete help.spec.ts E2E tests - Remove docs-site directory (migrated to D:\ccw-doc) The docs-site has been moved to D:\ccw-doc as a standalone Docusaurus project with baseUrl='/' for static hosting deployment (GitHub Pages/Netlify).
73 lines
2.0 KiB
TypeScript
73 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/'
|
|
|
|
// Backend target for Vite proxy (used when directly opening the Vite dev server port).
|
|
// In `ccw view`, this is set to the dashboard server port so /api and /ws route correctly.
|
|
const backendHost = process.env.VITE_BACKEND_HOST || 'localhost'
|
|
const backendPort = Number(process.env.VITE_BACKEND_PORT || '3456')
|
|
const backendHttpTarget = `http://${backendHost}:${backendPort}`
|
|
const backendWsTarget = `ws://${backendHost}:${backendPort}`
|
|
|
|
// 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: backendHttpTarget,
|
|
changeOrigin: true,
|
|
},
|
|
// WebSocket proxy for real-time updates
|
|
'/ws': {
|
|
target: backendWsTarget,
|
|
ws: true,
|
|
},
|
|
},
|
|
},
|
|
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,
|
|
},
|
|
})
|