-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
115 lines (114 loc) · 3.23 KB
/
vite.config.ts
File metadata and controls
115 lines (114 loc) · 3.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import path from 'path'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { VitePWA } from 'vite-plugin-pwa'
// https://vite.dev/config/
export default defineConfig({
base: process.env.VITE_BASE_PATH || '/transcript-parser/', // Use subdirectory path for production, overridable for Electron
plugins: [
react(),
VitePWA({
registerType: 'autoUpdate',
includeAssets: ['favicon.ico', 'robots.txt', 'apple-touch-icon.png'],
manifest: {
name: 'Transcript Parser',
short_name: 'TranscriptParser',
description: 'AI-powered video transcription with speaker diarization',
theme_color: '#10b981',
background_color: '#ffffff',
display: 'standalone',
orientation: 'portrait',
scope: '/transcript-parser/',
start_url: '/transcript-parser/',
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',
},
],
},
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2}'],
runtimeCaching: [
{
urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'google-fonts-cache',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 365, // 1 year
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
{
urlPattern: /^https:\/\/generativelanguage\.googleapis\.com\/.*/i,
handler: 'NetworkFirst',
options: {
cacheName: 'api-cache',
expiration: {
maxEntries: 50,
maxAgeSeconds: 60 * 5, // 5 minutes
},
networkTimeoutSeconds: 10,
},
},
],
},
}),
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
headers: {
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Embedder-Policy': 'require-corp',
},
fs: {
// Allow serving files from public directory
strict: false,
},
},
optimizeDeps: {
exclude: ['@ffmpeg/ffmpeg', '@ffmpeg/util'],
},
assetsInclude: ['**/*.wasm'],
build: {
// Enable source maps for better debugging
sourcemap: true,
// Optimize chunk splitting
rollupOptions: {
output: {
manualChunks: {
// Vendor chunks for large dependencies
'react-vendor': ['react', 'react-dom'],
'ui-vendor': ['lucide-react'],
'ffmpeg-vendor': ['@ffmpeg/ffmpeg', '@ffmpeg/util'],
'virtual-vendor': ['@tanstack/react-virtual'],
},
},
},
// Chunk size warning limit
chunkSizeWarningLimit: 1000,
// Enable minification with esbuild (faster than terser)
minify: 'esbuild',
},
})