Files
Lucky_Wheel/apps/client/vite.config.ts
T
s.esmaeili afde44ab8a fix(core): resolve local client url redirects and stabilize dev environment
- enforce localhost:5174 for wheel campaign client URL in local development
- lock vite dev server ports using strictPort on admin (5173) and client (5174)
- sanitize .env.example and remove hardcoded staging domain
- configure root dev orchestration and docker multi-stage build context
2026-09-13 02:02:46 +03:30

50 lines
1.3 KiB
TypeScript

import vue from '@vitejs/plugin-vue';
import path from 'path';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@lucky-wheel/shared-types': path.resolve(__dirname, '../../packages/shared-types/src/index.ts'),
},
},
build: {
target: 'es2020',
cssCodeSplit: true,
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
if (id.includes('vue') || id.includes('pinia') || id.includes('vue-router')) {
return 'vendor-vue';
}
if (id.includes('lucide') || id.includes('canvas-confetti')) {
return 'vendor-ui';
}
}
if (id.includes('/components/wheels/')) {
const name = id.split('/components/wheels/')[1]?.split('.')[0];
if (name) return `wheel-${name.toLowerCase()}`;
}
},
},
},
},
server: {
port: 5174,
strictPort: true,
proxy: {
'/api': {
target: 'http://localhost:3000',
changeOrigin: true,
},
'/uploads': {
target: 'http://localhost:3000',
changeOrigin: true,
},
},
},
});