2026-09-10 01:58:29 +03:30
|
|
|
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'),
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-09-13 02:02:46 +03:30
|
|
|
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()}`;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-09-10 01:58:29 +03:30
|
|
|
server: {
|
|
|
|
|
port: 5174,
|
2026-09-13 02:02:46 +03:30
|
|
|
strictPort: true,
|
2026-09-10 01:58:29 +03:30
|
|
|
proxy: {
|
|
|
|
|
'/api': {
|
|
|
|
|
target: 'http://localhost:3000',
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
},
|
|
|
|
|
'/uploads': {
|
|
|
|
|
target: 'http://localhost:3000',
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
});
|