Files
bootnode/web/next.config.ts
zooqueenandHanzo Dev 344c12aeba web: static-export build for lux.cloud (Lux Cloud) Cloudflare Pages deploy
Deploy the web3 console as lux.cloud (Lux brand). Convert from SSR
(output: standalone) to static export so it serves as static assets on
Cloudflare Pages with no edge/Node runtime.

- next.config.ts: output "export" + images.unoptimized; drop headers()/
  redirects() (unsupported in export) — moved to public/_headers and
  public/_redirects for Pages.
- app/layout.tsx: bake brand from NEXT_PUBLIC_BRAND/BRAND; remove
  force-dynamic + headers() host detection (client still auto-detects brand
  from window.location.hostname via lib/brand.ts).
- app/api/health, app/llms.txt: mark route handlers force-static.
- Remove app/dashboard/api/keys route handler (backend proxy unsupported in
  export; the dashboard talks to brand.apiUrl directly).
- nodes/[id]: split into a server page.tsx (generateStaticParams) + client
  node-detail-client.tsx so the dynamic segment is export-compatible.
- unified-navigation.tsx: fix API Keys link to the real /dashboard/api-keys
  page (was pointing at the removed route handler).
- lib/brand.ts: point lux IAM clientId at the real Casdoor app "lux-cloud"
  (clientId lux-app-client-id does not exist in IAM).

Built with NEXT_PUBLIC_BRAND=lux, IAM lux.id / client lux-cloud; deployed to
CF Pages project lux-cloud, custom domain lux.cloud.

Co-authored-by: Hanzo Dev <[email protected]>
2026-06-16 04:36:04 -07:00

35 lines
1.0 KiB
TypeScript

import type { NextConfig } from "next"
const nextConfig: NextConfig = {
// Modern React & Next.js features
reactStrictMode: true,
// 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.
}
export default nextConfig