fix: Gitea CI/CD und Blank-Page-Fehler behoben
- Helmet CSP: upgrade-insecure-requests und HSTS für HTTP-Deployments deaktiviert (war die Ursache der leeren Seite - Browser versuchte JS über HTTPS zu laden) - Backend: statische Dateien werden jetzt in allen NODE_ENV-Modi serviert - Frontend: IS_DEV erkennt auch VITE_TEST_MODE=true (Build-Zeit Variable) - Dockerfile: VITE_TEST_MODE=true beim Vite-Build, NODE_ENV=development - docker-compose.yml: NODE_ENV=development, CORS_ORIGIN=* - Gitea Workflow: Auth-Token für git clone, Build via Portainer API statt lokaler Docker CLI Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,14 +7,12 @@ import AdminPage from './pages/AdminPage';
|
||||
import AgentChat from './components/AgentChat';
|
||||
import styles from './App.module.css';
|
||||
|
||||
const IS_DEV = import.meta.env.DEV;
|
||||
const IS_DEV = import.meta.env.DEV || import.meta.env.VITE_TEST_MODE === 'true';
|
||||
|
||||
// Lazy-load DevPanel nur in Development
|
||||
// Lazy-load DevPanel in Development/Test-Mode
|
||||
let DevPanel: React.ComponentType<any> | null = null;
|
||||
if (IS_DEV) {
|
||||
// Dynamic import — kein Bundle-Impact in Production
|
||||
import('./components/DevPanel').then(m => { DevPanel = m.default; });
|
||||
}
|
||||
// VITE_TEST_MODE wird erst zur Laufzeit geprüft, daher Import immer einbinden
|
||||
import('./components/DevPanel').then(m => { DevPanel = m.default; }).catch(() => {});
|
||||
|
||||
export default function App() {
|
||||
const [devUser, setDevUser] = useState(1);
|
||||
|
||||
Vendored
+8
@@ -1,3 +1,11 @@
|
||||
interface Window {
|
||||
_devUser?: number;
|
||||
}
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_TEST_MODE?: string;
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user