51 lines
1.3 KiB
TypeScript
51 lines
1.3 KiB
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import path from 'path'
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
server: {
|
|
port: 3000,
|
|
allowedHosts: true,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://0.0.0.0:1726', // Порт твоего бэкенда
|
|
changeOrigin: true,
|
|
secure: false,
|
|
// Раскомментируй, если нужно видеть реальные запросы:
|
|
// configure: (proxy, options) => {
|
|
// proxy.on('proxyReq', (proxyReq, req, res) => {
|
|
// console.log('Proxying:', req.method, req.url)
|
|
// })
|
|
// },
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
sourcemap: false,
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks(id) {
|
|
if (id.includes('node_modules')) {
|
|
if (id.includes('react') || id.includes('react-dom') || id.includes('react-router-dom')) {
|
|
return 'vendor'
|
|
}
|
|
if (id.includes('@mantine')) {
|
|
return 'ui'
|
|
}
|
|
if (id.includes('@tanstack') || id.includes('axios')) {
|
|
return 'query'
|
|
}
|
|
return 'vendor-misc'
|
|
}
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}) |