Files
Velocity-OS/webos/vite.config.ts
Sagnik Ghosh 70ef8578d0
Some checks failed
Velocity-OS Deployment Pipeline / lint (push) Has been cancelled
Velocity-OS Deployment Pipeline / build-and-push (agents) (push) Has been cancelled
Velocity-OS Deployment Pipeline / build-and-push (core) (push) Has been cancelled
Velocity-OS Deployment Pipeline / build-and-push (media-engine) (push) Has been cancelled
Velocity-OS Deployment Pipeline / build-and-push (webos) (push) Has been cancelled
Velocity-OS Deployment Pipeline / sign-images (agents) (push) Has been cancelled
Velocity-OS Deployment Pipeline / sign-images (core) (push) Has been cancelled
Velocity-OS Deployment Pipeline / sign-images (media-engine) (push) Has been cancelled
Velocity-OS Deployment Pipeline / sign-images (webos) (push) Has been cancelled
Velocity-OS Deployment Pipeline / notify-ingress (push) Has been cancelled
fix: Backend added along with missing pages
2026-05-01 14:42:42 +05:30

75 lines
2.1 KiB
TypeScript

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
/**
* Velocity-OS — Vite Configuration
* Dev server proxies /api and /ws to core-api on port 8443.
* Production build output: dist/ (served by Nginx in Docker).
*/
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@/components/ui': path.resolve(__dirname, './src/shared/ui'),
'@/hooks': path.resolve(__dirname, './src/shared/hooks'),
'@/lib': path.resolve(__dirname, './src/shared/lib'),
'@/store': path.resolve(__dirname, './src/store'),
'@/types': path.resolve(__dirname, './src/shared/types'),
'@/utils': path.resolve(__dirname, './src/shared/utils'),
},
},
server: {
port: 3000,
host: true,
proxy: {
// REST API → core-api
'/api': {
target: 'http://localhost:8443',
changeOrigin: true,
secure: false,
},
// WebSocket → core-api
'/ws': {
target: 'ws://localhost:8443',
ws: true,
changeOrigin: true,
},
// Dream Weaver gateway
'/dream-weaver': {
target: 'http://localhost:8290',
changeOrigin: true,
},
},
},
build: {
outDir: 'dist',
sourcemap: false, // no source maps in production build
minify: 'esbuild',
rollupOptions: {
output: {
// Content-hash filenames for immutable caching
entryFileNames: 'assets/[name].[hash].js',
chunkFileNames: 'assets/[name].[hash].js',
assetFileNames: 'assets/[name].[hash].[ext]',
// Manual chunks to keep vendor bundle separate
manualChunks: {
'vendor-react': ['react', 'react-dom', 'react-router-dom'],
'vendor-motion': ['framer-motion'],
'vendor-three': ['three', '@react-three/fiber', '@react-three/drei'],
'vendor-query': ['@tanstack/react-query'],
'vendor-zustand': ['zustand'],
},
},
},
},
optimizeDeps: {
include: ['react', 'react-dom', 'framer-motion', 'zustand', '@tanstack/react-query'],
},
});