Files
OpenFlare/frontend/next.config.ts
T
ryan 1625cfb2fb feat(frontend): add next-intl bilingual i18n for core paths
Wire next-intl without locale routes, add zh-CN/en catalogs, language
switcher, and migrate layout/auth/settings UI copy. Document i18n rules
in AGENTS.md and keep static export builds working.
2026-07-24 16:25:41 +08:00

39 lines
1.0 KiB
TypeScript

import type { NextConfig } from 'next';
import createNextIntlPlugin from 'next-intl/plugin';
const withNextIntl = createNextIntlPlugin('./i18n/request.ts');
const isExport = process.env.NEXT_STANDALONE_EXPORT === 'true';
const nextConfig: NextConfig = {
reactCompiler: true,
experimental: {},
...(isExport
? { output: 'export' }
: {
async rewrites() {
const backendUrl =
process.env.WAVELET_BACKEND_URL || 'http://localhost:8000';
return [
// 上传文件静态资源
{
source: '/f/:id',
destination: `${backendUrl}/f/:id`,
},
// robots.txt 路由代理到后端动态接口
{
source: '/robots.txt',
destination: `${backendUrl}/robots.txt`,
},
// 标准 RESTful API 接口
{
source: '/api/:path*',
destination: `${backendUrl}/api/:path*`,
},
];
},
}),
};
export default withNextIntl(nextConfig);