Files
taiji-pad-v0/next.config.mjs
T
xiaohei 4511fe5694 fix(azure): apply correct Azure SWA approach for Next.js
BREAKING CHANGES:
- Switch to static export mode (output: 'export') per Azure SWA best practices
- Remove staticwebapp.config.json to avoid routes.json conflict
- Convert server-side layouts to client-side only (remove cookies() usage)
- Auth now handled entirely by client-side AuthGuard component
- Output directory changed from .next/standalone to 'out'
- Remove redirects from next.config (not supported in static export)

This aligns with Azure Static Web Apps' official recommendation for Next.js.
Server-side features (SSR, API routes, server actions) are not supported.
All authentication and routing is client-side via React components.
2025-12-29 08:05:05 +00:00

27 lines
639 B
JavaScript

/** @type {import('next').NextConfig} */
const nextConfig = {
// Azure SWA 官方推荐:Next.js 静态导出模式
output: 'export',
// 禁用需要服务器的功能
images: {
unoptimized: true,
},
typescript: {
ignoreBuildErrors: true,
},
// 静态导出时的 trailing slash 配置
trailingSlash: true,
// 环境变量配置
env: {
NEXT_PUBLIC_DATA_INGESTION_URL: process.env.NEXT_PUBLIC_DATA_INGESTION_URL,
NEXT_PUBLIC_MCP_SERVER_URL: process.env.NEXT_PUBLIC_MCP_SERVER_URL,
NEXT_PUBLIC_API_GATEWAY_URL: process.env.NEXT_PUBLIC_API_GATEWAY_URL,
},
}
export default nextConfig