Files
Maestro/vite.config.mts
Pedram Amini 3f1788d196 perf: Optimize AI input responsiveness and production builds
- Fix AI input lag by using local state for typing, syncing to session
  state only on blur/submit instead of every keystroke
- Add esbuild.drop to strip console.* and debugger in production builds
- Memoize handleInputFocus and handleSessionClick callbacks in MainPanel
- Simplify textarea auto-grow by removing unnecessary RAF scheduling
- Fix AgentSessionsBrowser by changing button to div (nested button issue)
- Restore legacy history filter fallback for entries without sessionId

Claude ID: 33f0f964-5b7f-4240-9e40-8eddcecafe8e
Maestro ID: b9bc0d08-5be2-4fdf-93cd-5618a8d53b35
2025-12-01 09:38:28 -06:00

30 lines
905 B
TypeScript

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
import { readFileSync } from 'fs';
// Read version from package.json as fallback
const packageJson = JSON.parse(readFileSync(path.join(__dirname, 'package.json'), 'utf-8'));
// Use VITE_APP_VERSION env var if set (during CI builds), otherwise use package.json
const appVersion = process.env.VITE_APP_VERSION || packageJson.version;
export default defineConfig(({ mode }) => ({
plugins: [react()],
root: path.join(__dirname, 'src/renderer'),
base: './',
define: {
__APP_VERSION__: JSON.stringify(appVersion),
},
esbuild: {
// Strip console.log and console.debug in production builds
drop: mode === 'production' ? ['console', 'debugger'] : [],
},
build: {
outDir: path.join(__dirname, 'dist/renderer'),
emptyOutDir: true,
},
server: {
port: 5173,
},
}));