import type { NextConfig } from "next"; /** * visionA Agent — 前端 Next.js 設定 * * 本前端會被 Wails 嵌入桌面應用(macOS / Windows / Linux), * 因此採用「靜態匯出」(static export) 策略: * * - output: "export" * Next.js 將整個應用編譯為純靜態 HTML / JS / CSS(產出至 `out/`), * Wails build 階段透過 `assetdir: "./frontend/out"` 將其 `go:embed` 進可執行檔。 * 對應 TDD §2.2、§3 與 ADR:「visionA Agent 前端用 Next.js + output: 'export'」。 * * - trailingSlash: true * 靜態匯出時讓每條 route 對應 `index.html`,避免 Wails WebView 載入 sub-route 時 404。 * 此設定與 local-tool 一致(local-tool 已長期驗證可正常嵌入 Wails)。 * * - images.unoptimized: true * `output: "export"` 不支援 next/image 預設的 server-side optimizer; * 必須關閉以避免 build 報錯(TDD §3.2 注意事項)。 * * 不沿用 visionA-frontend 的 `output: "standalone"`: * 標準 Next.js server bundle 適合 Vercel / Docker 部署,但 Wails 不會跑 Node server。 */ const nextConfig: NextConfig = { output: "export", trailingSlash: true, reactStrictMode: true, images: { unoptimized: true, }, }; export default nextConfig;