mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-16 13:20:39 -07:00
Problem: The server binary with CUDA support was 2.9GB, causing: - MSI installer failures in CI (WiX can't handle 3GB files) - Massive downloads for all users (even those without GPUs) - Poor user experience Solution: Build two separate server binaries: - voicebox-server.exe (CPU-only, ~295MB) - ships with installer - voicebox-server-cuda.exe (CUDA, ~2.9GB) - optional download Changes: - backend/build_binary.py: Added 'variant' parameter for CPU/CUDA builds - backend/build_cpu.bat: Script to build CPU-only binary - backend/build_cuda.bat: Script to build CUDA binary - backend/build_both.bat: Script to build both binaries - backend/build_cpu.sh: Unix build script for CPU binary - .github/workflows/release.yml: Build both variants, upload CUDA separately - tauri/vite.config.ts: Externalize Tauri plugins to fix build - docs/dual-server-binaries.md: Complete documentation Results: - Installer size reduced from 3GB to ~500MB (6x smaller) - CI builds now succeed (WiX can handle 500MB) - GPU users can opt-in to download CUDA support - Better bandwidth usage for CPU-only users Next steps: - Frontend implementation to detect GPU and download CUDA binary - Settings UI to toggle between CPU/CUDA modes Co-Authored-By: Claude Sonnet 4.5 (1M context) <[email protected]>
50 lines
1.5 KiB
TypeScript
50 lines
1.5 KiB
TypeScript
import path from 'node:path';
|
|
import react from '@vitejs/plugin-react';
|
|
import tailwindcss from '@tailwindcss/vite';
|
|
import { defineConfig } from 'vite';
|
|
|
|
export default defineConfig({
|
|
plugins: [react(), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, '../app/src'),
|
|
react: path.resolve(__dirname, '../app/node_modules/react'),
|
|
'react-dom': path.resolve(__dirname, '../app/node_modules/react-dom'),
|
|
'@tanstack/react-query': path.resolve(__dirname, '../app/node_modules/@tanstack/react-query'),
|
|
'@tanstack/react-query-devtools': path.resolve(
|
|
__dirname,
|
|
'../app/node_modules/@tanstack/react-query-devtools',
|
|
),
|
|
zustand: path.resolve(__dirname, '../app/node_modules/zustand'),
|
|
},
|
|
dedupe: ['react', 'react-dom', '@tanstack/react-query', 'zustand'],
|
|
},
|
|
root: path.resolve(__dirname),
|
|
clearScreen: false,
|
|
server: {
|
|
port: 5173,
|
|
strictPort: true,
|
|
// Watch files in the app directory for changes
|
|
watch: {
|
|
ignored: ['!**/../app/**'],
|
|
},
|
|
},
|
|
envPrefix: ['VITE_', 'TAURI_'],
|
|
build: {
|
|
target: 'es2021',
|
|
minify: !process.env.TAURI_DEBUG,
|
|
sourcemap: !!process.env.TAURI_DEBUG,
|
|
outDir: 'dist',
|
|
rollupOptions: {
|
|
external: [
|
|
'@tauri-apps/api',
|
|
'@tauri-apps/plugin-dialog',
|
|
'@tauri-apps/plugin-fs',
|
|
'@tauri-apps/plugin-process',
|
|
'@tauri-apps/plugin-shell',
|
|
'@tauri-apps/plugin-updater',
|
|
],
|
|
},
|
|
},
|
|
});
|