build: Konfiguration für statische Exporte mit Umgebungsvariable optimiert
- output: "export" wird jetzt automatisch bei EXPORT_STATIC=true aktiviert - Entwicklungsmodus (npm run dev) nutzt weiterhin API-Routen für Mock-Tests - Neues npm-Skript nutzt cross-env für Umgebungsunabhängigkeit bei Windows/Linux - cross-env als devDependency hinzugefügt
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
|
||||
const isExport = process.env.EXPORT_STATIC === "true";
|
||||
|
||||
const nextConfig = {
|
||||
reactStrictMode: true, // Aktiviert Strict Mode zur Identifizierung potenzieller Probleme in der Anwendung
|
||||
//output: "export", // Stellt sicher, dass Next.js eine statische Version der Website generiert (SSG)
|
||||
trailingSlash: false, // Fügt einen Schrägstrich am Ende der URLs hinzu (nützlich für statische Verzeichnisse)
|
||||
reactStrictMode: true,
|
||||
trailingSlash: false,
|
||||
images: {
|
||||
unoptimized: true, // Verzichtet auf Next.js' Bildoptimierung (nützlich für statische Exporte)
|
||||
unoptimized: true,
|
||||
},
|
||||
...(isExport && { output: "export" }), // ⬅️ dynamisch aktivieren
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
|
||||
Reference in New Issue
Block a user