group conversations with models and local files
1import { defineConfig } from 'vite'
2import react from '@vitejs/plugin-react'
3import { VitePWA } from 'vite-plugin-pwa'
4import wasm from 'vite-plugin-wasm'
5import topLevelAwait from 'vite-plugin-top-level-await'
6
7export default defineConfig({
8 plugins: [
9 // Automerge ships WASM via the "bundler" condition; vite-plugin-wasm
10 // handles the import. top-level-await is required because the wasm
11 // entrypoint awaits the wasm module asynchronously.
12 wasm(),
13 topLevelAwait(),
14 react(),
15 VitePWA({
16 registerType: 'autoUpdate',
17 // Disabled in dev; service worker only kicks in on prod build.
18 devOptions: { enabled: false },
19 manifest: {
20 name: 'Hezo',
21 short_name: 'Hezo',
22 description: 'Shared Claude conversations + project files for a small group.',
23 theme_color: '#1a1a1a',
24 background_color: '#1a1a1a',
25 display: 'standalone',
26 start_url: '/',
27 scope: '/',
28 icons: [
29 { src: '/icon.svg', sizes: 'any', type: 'image/svg+xml', purpose: 'any' },
30 { src: '/icon-192.png', sizes: '192x192', type: 'image/png', purpose: 'any maskable' },
31 { src: '/icon-512.png', sizes: '512x512', type: 'image/png', purpose: 'any maskable' },
32 ],
33 },
34 workbox: {
35 // Cache the app shell; everything else (API, blobs, WS) is dynamic.
36 globPatterns: ['**/*.{js,css,html,svg,woff2}'],
37 // Don't try to cache anything under /api or /ws.
38 navigateFallback: '/index.html',
39 navigateFallbackDenylist: [/^\/api/, /^\/ws/],
40 // Take over from the previous SW on the first reload after a
41 // deploy, instead of waiting for every tab to close first.
42 skipWaiting: true,
43 clientsClaim: true,
44 },
45 }),
46 ],
47 server: {
48 port: 5173,
49 proxy: {
50 '/api': 'http://localhost:3001',
51 '/ws': { target: 'ws://localhost:3001', ws: true },
52 },
53 },
54 build: {
55 outDir: 'dist-web',
56 emptyOutDir: true,
57 },
58})