next.config.mjs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /** @type {import('next').NextConfig} */
  2. import bundleAnalyzer from "@next/bundle-analyzer";
  3. import createNextIntlPlugin from "next-intl/plugin";
  4. const withNextIntl = createNextIntlPlugin();
  5. /** @type {import('next').NextConfig} */
  6. const nextConfig = {
  7. // output: "standalone",
  8. productionBrowserSourceMaps: true,
  9. reactStrictMode: false,
  10. env: {
  11. BUILD_ENV: process.env.BUILD_ENV,
  12. },
  13. transpilePackages: ["antd-mobile"],
  14. sassOptions: {
  15. quietDeps: true,
  16. prependData: `@import "./src/styles/variables.scss";`,
  17. },
  18. logging: {
  19. fetches: {
  20. fullUrl: true,
  21. },
  22. },
  23. experimental: {
  24. staleTimes: {
  25. dynamic: 0,
  26. static: 180,
  27. },
  28. scrollRestoration: true,
  29. optimizePackageImports: [
  30. "dayjs",
  31. "bignumber.js",
  32. "@lucky-canvas/react",
  33. "@number-flow/react",
  34. "framer-motion",
  35. "next-intl",
  36. "next",
  37. "next-themes",
  38. "react",
  39. "react-dom",
  40. ],
  41. },
  42. images: {
  43. domains: [
  44. "minio.tiktokjakjkl.icu",
  45. "bcwin.s3.sa-east-1.amazonaws.com",
  46. "192.168.0.237",
  47. "static.tiktokjakjkl.icu",
  48. ],
  49. remotePatterns: [
  50. {
  51. protocol: "https",
  52. hostname: "minio.tiktokjakjkl.icu",
  53. pathname: "*",
  54. },
  55. {
  56. protocol: "https",
  57. hostname: "images.hibigwin.com",
  58. pathname: "*",
  59. },
  60. {
  61. protocol: "https",
  62. hostname: "bcwin.s3.sa-east-1.amazonaws.com",
  63. pathname: "*",
  64. },
  65. {
  66. protocol: "https",
  67. hostname: "static.tiktokjakjkl.icu",
  68. pathname: "*",
  69. },
  70. ],
  71. },
  72. };
  73. const withBundleAnalyzer = bundleAnalyzer({
  74. enabled: process.env.ANALYZE === "true",
  75. });
  76. export default withBundleAnalyzer(withNextIntl(nextConfig));