next.config.ts 946 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /** @type {import('next').NextConfig} */
  2. import {NextConfig} from "next";
  3. const nextConfig: NextConfig = {
  4. // 关闭构建时的 TypeScript 检查
  5. typescript: {
  6. ignoreBuildErrors: true,
  7. },
  8. // 关闭构建时的 ESLint 检查
  9. eslint: {
  10. ignoreDuringBuilds: true,
  11. },
  12. // 代理重定向到后台服务
  13. async rewrites() {
  14. return {
  15. fallback: [
  16. {
  17. source: "/api/system/user",
  18. destination: `${process.env.BACKEND_URL}/system/user/`,
  19. },
  20. {
  21. source: "/api/:path*",
  22. destination: `${process.env.BACKEND_URL}/:path*`,
  23. },
  24. ],
  25. };
  26. },
  27. images: {
  28. dangerouslyAllowSVG: true,
  29. contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;",
  30. remotePatterns: [
  31. {
  32. protocol: "https",
  33. hostname: "img.shields.io",
  34. port: "",
  35. pathname: "/**",
  36. },
  37. ],
  38. },
  39. };
  40. module.exports = nextConfig;