- Добавлены инструкции `docs/UBUNTU_SETUP.md` и секции в README. - Добавлены скрипты `scripts/setup-postgres-ubuntu.sh` и `scripts/start-tmux.sh` (tmux: front/back). - Для доступа снаружи: Vite `allowedHosts: true`, бэкенд слушает `0.0.0.0`. - Добавлен сид демо-пользователя портала `demo` / `demo123` с ролью DIRECTOR (как `its`). - `.env` файлы добавлены в `.gitignore`, чтобы не коммитить секреты. Выполнил: Арсен. Co-authored-by: Cursor <cursoragent@cursor.com>
52 lines
1.3 KiB
TypeScript
Executable File
52 lines
1.3 KiB
TypeScript
Executable File
import path from 'path';
|
|
import { defineConfig, loadEnv } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, '.', '');
|
|
return {
|
|
server: {
|
|
port: 3000,
|
|
host: '0.0.0.0',
|
|
allowedHosts: true,
|
|
proxy: {
|
|
'/api': {
|
|
target: process.env.API_PROXY_TARGET || 'http://localhost:4000',
|
|
changeOrigin: true,
|
|
secure: false
|
|
},
|
|
'/uploads': {
|
|
target: process.env.API_PROXY_TARGET || 'http://localhost:4000',
|
|
changeOrigin: true,
|
|
secure: false
|
|
}
|
|
}
|
|
},
|
|
preview: {
|
|
port: 3000,
|
|
host: '0.0.0.0'
|
|
},
|
|
plugins: [react()],
|
|
envPrefix: 'VITE_',
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, '.'),
|
|
}
|
|
},
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: (id) => {
|
|
if (id.includes('node_modules/react/') || id.includes('node_modules/react-dom/')) {
|
|
return 'vendor-react';
|
|
}
|
|
if (id.includes('node_modules/lucide-react')) {
|
|
return 'vendor-lucide';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
});
|