feat(azure): apply Azure SWA best practices for Next.js
- Add standalone output mode in next.config.mjs - Configure environment variables with .env.example - Update staticwebapp.config.json with proper routing and fallback - Optimize GitHub Actions workflow with npm cache and env vars - Set output_location to .next/standalone for SWA deployment - Preserve all business logic in API client, auth, and components
This commit is contained in:
@@ -1,11 +1,23 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
// Azure SWA 最佳实践:输出独立服务器模式
|
||||
output: 'standalone',
|
||||
|
||||
typescript: {
|
||||
ignoreBuildErrors: true,
|
||||
},
|
||||
|
||||
images: {
|
||||
unoptimized: 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,
|
||||
},
|
||||
|
||||
async redirects() {
|
||||
return [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user