next.config.mjs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. "antd-mobile",
  31. "dayjs",
  32. "bignumber.js",
  33. "@lucky-canvas/react",
  34. "@number-flow/react",
  35. "framer-motion",
  36. "next-intl",
  37. "next",
  38. "next-themes",
  39. "react",
  40. "react-dom",
  41. ],
  42. },
  43. images: {
  44. domains: [
  45. "minio.tiktokjakjkl.icu",
  46. "bcwin.s3.sa-east-1.amazonaws.com",
  47. "192.168.0.237",
  48. "static.tiktokjakjkl.icu",
  49. ],
  50. remotePatterns: [
  51. {
  52. protocol: "https",
  53. hostname: "minio.tiktokjakjkl.icu",
  54. pathname: "*",
  55. },
  56. {
  57. protocol: "https",
  58. hostname: "images.hibigwin.com",
  59. pathname: "*",
  60. },
  61. {
  62. protocol: "https",
  63. hostname: "bcwin.s3.sa-east-1.amazonaws.com",
  64. pathname: "*",
  65. },
  66. {
  67. protocol: "https",
  68. hostname: "static.tiktokjakjkl.icu",
  69. pathname: "*",
  70. },
  71. ],
  72. },
  73. };
  74. const withBundleAnalyzer = bundleAnalyzer({
  75. enabled: process.env.ANALYZE === "true",
  76. });
  77. export default withBundleAnalyzer(withNextIntl(nextConfig));