From 136f88b4c7cd7f5173b6a0df6c75949657a6b325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=85=83=E5=9D=A4?= Date: Thu, 10 Jul 2025 13:23:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- next.config.js | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/next.config.js b/next.config.js index 3a645cb..20649ea 100644 --- a/next.config.js +++ b/next.config.js @@ -1,34 +1,32 @@ /** @type {import('next').NextConfig} */ const nextConfig = { - devIndicators: false, // show dev tools - productionBrowserSourceMaps: false, // enable browser source map generation during the production build - // Configure pageExtensions to include md and mdx - pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'], - experimental: { - // appDir: true, + reactStrictMode: true, + // 压缩优化(Next.js 13+默认启用SWC,无需手动配置) + compress: true, + + // 图片优化 + images: { + formats: ["image/avif", "image/webp"], + domains: ["cdn.yourdomain.com"], }, - // fix all before production. Now it slow the develop speed. - eslint: { - // Warning: This allows production builds to successfully complete even if - // your project has ESLint errors. - ignoreDuringBuilds: true, - }, - typescript: { - // https://nextjs.org/docs/api-reference/next.config.js/ignoring-typescript-errors - ignoreBuildErrors: true, + + // 修正后的开发指示器配置 + devIndicators: { + position: "bottom-right", // 新版统一用position }, + + // 页面扩展名 + pageExtensions: ["ts", "tsx", "js", "jsx", "md", "mdx"], + + // 路由重写 async rewrites() { return [ { - source: '/files/:path*', - destination: `${process.env.NEXT_PUBLIC_FILES_URL}/:path*`, + source: "/dev-api/:path*", + destination: "http://192.168.6.9:8085/:path*", }, - { - source: '/dev-api/:path*', - destination: 'http://192.168.6.9:8085/:path*', - }, - ] + ]; }, -} +}; -module.exports = nextConfig +module.exports = nextConfig;