Files
clawtap/vite.config.ts
T
izackp edbecd2c83 Add Ghostty terminal, session recovery, voice asset caching, and gitignore large assets
Integrates ghostty-web and node-pty packages, adds tmux session recovery on startup,
refactors WebSocket transport to noServer mode, caches Sherpa voice model assets via
service worker. Large assets (sherpa, ghostty-vt.wasm, fonts) are now gitignored as
they are copied from the webterm project.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-20 08:39:44 -04:00

82 lines
2.1 KiB
TypeScript

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import tailwindcss from '@tailwindcss/vite';
import { VitePWA } from 'vite-plugin-pwa';
import path from 'path';
export default defineConfig({
plugins: [
react(),
tailwindcss(),
VitePWA({
strategies: 'injectManifest',
srcDir: 'src',
filename: 'sw.ts',
registerType: 'autoUpdate',
manifest: {
name: 'ClawTap',
short_name: 'ClawTap',
description: 'Control Claude Code from your phone',
theme_color: '#09090b',
background_color: '#09090b',
display: 'standalone',
orientation: 'portrait',
scope: '/',
start_url: '/',
icons: [
{ src: '/pwa-192x192.png', sizes: '192x192', type: 'image/png' },
{ src: '/pwa-512x512.png', sizes: '512x512', type: 'image/png' },
{ src: '/maskable-512x512.png', sizes: '512x512', type: 'image/png', purpose: 'maskable' },
],
shortcuts: [
{
name: 'New Chat',
short_name: 'New',
url: '/?action=newchat',
icons: [{ src: '/pwa-192x192.png', sizes: '192x192' }],
},
],
categories: ['developer-tools', 'productivity'],
},
injectManifest: {
globPatterns: ['**/*.{js,css,html,ico,svg,woff2,wasm,ttf}', 'favicon-*.png', 'apple-touch-icon.png', 'badge-*.png', 'mascot/*.png'],
globIgnores: ['sherpa-moonshine-v2-base-en/**'],
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024, // 5 MiB (font is ~2.6 MiB)
},
}),
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
host: true,
proxy: {
'/api': {
target: 'https://localhost:3456',
secure: false,
},
'/ws': {
target: 'wss://localhost:3456',
ws: true,
secure: false,
},
'/terminal': {
target: 'wss://localhost:3456',
ws: true,
secure: false,
},
},
},
build: {
outDir: 'dist',
rollupOptions: {
external: ['node-pty'],
},
},
optimizeDeps: {
exclude: ['node-pty'],
},
});