next.config.mjs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. "swiper",
  41. "zustand",
  42. ],
  43. },
  44. images: {
  45. domains: [
  46. "minio.tiktokjakjkl.icu",
  47. "bcwin.s3.sa-east-1.amazonaws.com",
  48. "192.168.0.237",
  49. "static.tiktokjakjkl.icu",
  50. ],
  51. remotePatterns: [
  52. {
  53. protocol: "https",
  54. hostname: "minio.tiktokjakjkl.icu",
  55. pathname: "*",
  56. },
  57. {
  58. protocol: "https",
  59. hostname: "images.hibigwin.com",
  60. pathname: "*",
  61. },
  62. {
  63. protocol: "https",
  64. hostname: "bcwin.s3.sa-east-1.amazonaws.com",
  65. pathname: "*",
  66. },
  67. {
  68. protocol: "https",
  69. hostname: "static.tiktokjakjkl.icu",
  70. pathname: "*",
  71. },
  72. ],
  73. },
  74. };
  75. const withBundleAnalyzer = bundleAnalyzer({
  76. enabled: process.env.ANALYZE === "true",
  77. });
  78. export default withBundleAnalyzer(withNextIntl(nextConfig));