// next.config.ts import type { NextConfig } from 'next'; const nextConfig: NextConfig = { // 构建时报 TS 校验(可按需开启/关闭) typescript: { ignoreBuildErrors: false, }, // 将 ESM 包转译(如有 Tree-shaking/TS 产物需要) transpilePackages: ['lucide-react'], // 便于部署到容器/Serverless output: 'standalone', // 若有其它实验性开关可放这里(保持空对象即可) experimental: { // 例如:typedRoutes: true }, // 解决工作区根目录问题(通常保持默认即可;你这里明确指定也可) outputFileTracingRoot: process.cwd(), // 反向代理(避免本地 CORS) async rewrites() { return [ { source: '/api/:path*', destination: 'https://gitea-admin-hm-smart-agri-app.dev.maimaiag.com/api/:path*', }, ]; }, }; export default nextConfig;