next.config.ts 801 B

12345678910111213141516171819202122232425262728293031323334
  1. import type { NextConfig } from "next";
  2. // 从环境变量读取后端端口,默认 18080(避免与常用端口冲突)
  3. const backendPort = process.env.NEXT_PUBLIC_BACKEND_PORT || "18080";
  4. const nextConfig: NextConfig = {
  5. eslint: {
  6. ignoreDuringBuilds: true, // 临时禁用构建时的 ESLint 检查
  7. },
  8. images: {
  9. remotePatterns: [
  10. {
  11. protocol: "http",
  12. hostname: "192.168.124.9",
  13. port: backendPort,
  14. pathname: "/uploads/**",
  15. },
  16. {
  17. protocol: "http",
  18. hostname: "localhost",
  19. port: backendPort,
  20. pathname: "/uploads/**",
  21. },
  22. {
  23. protocol: "http",
  24. hostname: "127.0.0.1",
  25. port: backendPort,
  26. pathname: "/uploads/**",
  27. },
  28. ],
  29. },
  30. };
  31. export default nextConfig;