Files
clarity-helper/vite.config.ts
T
jpremill 1feea40684 feat(ui): redesign voice cockpit with clinical companion drawer, Svelte 5 migration, and Gemini 3.8 voice
- Re-architect VoiceSession into full-bleed studio cockpit with overlay slide-over companion drawer
- Eliminate width squishing defect on LiveInsightPanel and add native dark/light theme support
- Integrate authentic Google Gemini 3.8 Flash TTS with Fenrir persona and fallback audio pipeline
- Implement comprehensive Playwright E2E visual regression suite across Desktop, iPad, and iPhone (21 tests, 45 snapshots)
- Migrate core application to Svelte 5 runes (, , ) with reactive stores
- Maintain .NET 8 Azure Functions serverless endpoints and clean build hygiene
2026-09-29 23:35:05 -04:00

88 lines
2.5 KiB
TypeScript

/// <reference types="vitest" />
import path from 'path';
import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
import { svelte } from '@sveltejs/vite-plugin-svelte';
import { VitePWA } from 'vite-plugin-pwa';
import pkg from './package.json';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, '.', '');
return {
server: {
port: 3000,
host: '0.0.0.0',
},
plugins: [
react(),
svelte(),
VitePWA({
strategies: 'injectManifest',
srcDir: '.',
filename: 'sw.ts',
registerType: 'autoUpdate',
injectRegister: 'auto',
devOptions: {
enabled: false,
},
manifest: {
name: 'Cognitive Clarity',
short_name: 'Clarity',
description: 'CBT Case Conceptualization & Roleplay AI',
theme_color: '#0f172a',
background_color: '#0f172a',
display: 'standalone',
icons: [
{
src: 'pwa-192x192.png',
sizes: '192x192',
type: 'image/png'
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png'
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'any maskable'
}
]
}
})
],
define: {
'process.env.OPENROUTER_API_KEY': JSON.stringify(env.VITE_OPENROUTER_API_KEY || env.OPENROUTER_API_KEY || ''),
'process.env.GEMINI_API_KEY': JSON.stringify(env.VITE_GEMINI_API_KEY || env.GEMINI_API_KEY || ''),
'process.env.API_KEY': JSON.stringify(env.VITE_GEMINI_API_KEY || env.GEMINI_API_KEY || ''),
'__APP_VERSION__': JSON.stringify(pkg.version),
'__BUILD_TIMESTAMP__': JSON.stringify(new Date().toISOString()),
},
build: {
chunkSizeWarningLimit: 600,
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
if (id.includes('@lucide/svelte') || id.includes('lucide-react')) return 'vendor-icons';
if (id.includes('svelte')) return 'vendor-svelte';
if (id.includes('workbox')) return 'vendor-workbox';
}
}
}
}
},
resolve: {
alias: {
'@': path.resolve(__dirname, '.'),
}
},
test: {
include: ['test/**/*.test.ts'],
environment: 'node'
}
};
});