prvi kod za live uporabu
Some checks failed
ERP CI Pipeline / test (push) Has been cancelled

This commit is contained in:
mariomitte
2026-07-09 21:21:17 +02:00
parent 857bb65d52
commit 5d39e048ba
239 changed files with 25151 additions and 0 deletions

62
frontend/astro.config.mjs Normal file
View File

@@ -0,0 +1,62 @@
// @ts-check
import { defineConfig } from 'astro/config';
import node from '@astrojs/node';
import tailwindcss from '@tailwindcss/vite';
import preact from '@astrojs/preact';
const isDev = process.env.NODE_ENV === 'development';
// https://astro.build/config
export default defineConfig({
output: 'server',
adapter: node({
mode: 'standalone'
}),
// 🛰️ Postavke razvojnog poslužitelja unutar Docker mreže
server: {
host: true, // Sluša na 0.0.0.0 unutar kontejnera
port: 4321, // Unutarnji port kontejnera
},
vite: {
resolve: {
alias: {
react: 'preact/compat',
'react-dom': 'preact/compat',
'react-dom/test-utils': 'preact/test-utils',
'react/jsx-runtime': 'preact/jsx-runtime',
'react/jsx-dev-runtime': 'preact/jsx-dev-runtime',
},
},
define: {
__PUSHER_KEY__: JSON.stringify(process.env.PUBLIC_PUSHER_KEY || process.env.PUSHER_KEY || ''),
__PUSHER_CLUSTER__: JSON.stringify(process.env.PUBLIC_PUSHER_CLUSTER || process.env.PUSHER_CLUSTER || ''),
},
ssr: {
noExternal: ['@react-spring/web', '@react-spring/core', '@react-spring/animated', '@react-spring/shared'],
},
build: {
assetsInlineLimit: 1024,
},
plugins: [tailwindcss()],
// ⚙️ Ugrađene preporuke za Docker File Watching i Tihi Refresh (HMR)
server: isDev ? {
hmr: {
protocol: 'ws',
host: 'localhost',
// Mora odgovarati mapiranom portu u docker-compose (4321:4321)
clientPort: 4321,
},
watch: {
// Prisiljava Vite na "polling" sustav jer Windows/WSL2 volumeni nekad blokiraju inotify signale
usePolling: true,
interval: 100,
}
} : {}, // U produkciji je ovaj blok potpuno prazan radi maksimalnih performansi
},
// Redoslijed integracija: Tailwind pa Preact
integrations: [preact()],
});