Files
gohoarder/frontend/vite.config.ts
T
lukaszraczylo 0a0286df41 feat(frontend): add the perfect-design theme, shell and helpers
Install @perfect-design/ui 0.3.10 with the workbench style pack, IBM Plex
faces and the inline theme boot script. The app shell uses AppHeader, AppShell
and SidebarNav. Shared formatters, severity tones and icon data replace the
per-view copies. A test checks that main.css scans only the library
directories the app imports.
2026-11-23 02:29:13 +00:00

44 lines
1.1 KiB
TypeScript

import { defineConfig, type Plugin } from 'vite'
import vue from '@vitejs/plugin-vue'
import tailwindcss from '@tailwindcss/vite'
import { themeBootScript } from '@perfect-design/ui/stores/theme-boot'
// Get backend URL from environment or use default
const BACKEND_URL = process.env.VITE_BACKEND_URL || 'http://localhost:8080'
const FRONTEND_PORT = parseInt(process.env.VITE_PORT || '5173')
// Applies the saved colour mode before first paint so a dark system never flashes light.
function themeBoot(): Plugin {
return {
name: 'theme-boot',
transformIndexHtml: () => [{ tag: 'script', children: themeBootScript, injectTo: 'head' }],
}
}
export default defineConfig({
plugins: [vue(), tailwindcss(), themeBoot()],
resolve: {
alias: {
'@': import.meta.dirname + '/src',
},
},
server: {
port: FRONTEND_PORT,
proxy: {
'/api': {
target: BACKEND_URL,
changeOrigin: true,
},
'/ws': {
target: BACKEND_URL.replace('http', 'ws'),
ws: true,
changeOrigin: true,
},
},
},
build: {
outDir: 'dist',
sourcemap: false,
},
})