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;