import type { NextConfig } from "next" import { withLuxUi } from "@luxfi/ui/next" const nextConfig: NextConfig = { // Modern React & Next.js features reactStrictMode: true, poweredByHeader: false, // Static export for Cloudflare Pages (lux.cloud). // The app is client-rendered (auth via localStorage, brand auto-detected from // window.location.hostname in lib/brand.ts), so a static export serves the full // console as static assets on Pages' CDN — no edge/Node server required. output: "export", devIndicators: false, // Turbopack configuration (required for Next.js 16) turbopack: {}, // Image optimization is unavailable in static export; serve images as-is. images: { unoptimized: true, remotePatterns: [ { protocol: "https", hostname: "**", }, ], formats: ['image/avif', 'image/webp'] }, // NOTE: headers() and redirects() are not supported by `output: "export"`. // Security headers are applied by Cloudflare Pages via public/_headers, and // the legacy /admin -> /dashboard redirect is handled by public/_redirects. } // `withLuxUi` is the ONE place the @hanzo/gui engine's bundler wiring lives — // transpile list, react-native → react-native-web alias in both bundlers, the // platform defines, and the single-copy dedupe. Every Next surface needed the // identical incantation; the ones that hand-rolled it each transpiled a // different subset, which is how one app renders a Sheet and the next throws on // the same component. export default withLuxUi({ ...nextConfig, dir: __dirname } as never) as NextConfig