mirror of
https://github.com/open-jarvis/OpenJarvis.git
synced 2026-07-28 22:14:30 +00:00
60 lines
1.6 KiB
TypeScript
60 lines
1.6 KiB
TypeScript
import path from 'path';
|
|
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import tailwindcss from '@tailwindcss/vite';
|
|
import { VitePWA } from 'vite-plugin-pwa';
|
|
|
|
export default defineConfig({
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
plugins: [
|
|
react(),
|
|
tailwindcss(),
|
|
VitePWA({
|
|
registerType: 'autoUpdate',
|
|
manifest: {
|
|
name: 'OpenJarvis',
|
|
short_name: 'Jarvis',
|
|
description: 'On-device AI assistant',
|
|
theme_color: '#161618',
|
|
background_color: '#161618',
|
|
display: 'standalone',
|
|
icons: [
|
|
{ src: 'pwa-192x192.png', sizes: '192x192', type: 'image/png' },
|
|
{ src: 'pwa-512x512.png', sizes: '512x512', type: 'image/png' },
|
|
],
|
|
},
|
|
workbox: {
|
|
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
|
|
navigateFallbackDenylist: [/^\/v1\//, /^\/health/, /^\/dashboard/, /^\/api\//],
|
|
},
|
|
}),
|
|
],
|
|
build: {
|
|
outDir: '../src/openjarvis/server/static',
|
|
emptyOutDir: true,
|
|
minify: 'esbuild',
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
react: ['react', 'react-dom'],
|
|
markdown: ['react-markdown', 'rehype-highlight', 'remark-gfm'],
|
|
charts: ['recharts'],
|
|
router: ['react-router'],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
'/v1': process.env.VITE_API_URL || 'http://localhost:8000',
|
|
'/health': process.env.VITE_API_URL || 'http://localhost:8000',
|
|
'/api': process.env.VITE_API_URL || 'http://localhost:8000',
|
|
},
|
|
},
|
|
});
|