const nextConfig = {
  images: {
    remotePatterns: [
      {
        protocol: "https",
        hostname: "**",
      },
    ],
  },
  // allowedDevOrigins: ["swarnalayajewels.com", "148.72.246.172:4055"],
  experimental: {
    webpackBuildWorker: false,
    serverSourceMaps: true,
    optimizePackageImports: ["moment"],
  },

  productionBrowserSourceMaps: false,
  async rewrites() {
    return [
      {
        source: "/uploads/:path*",
        destination: "/api/uploads/:path*",
      },
    ];
  },

  // webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
  //   config.parallelism = 1;

  //   config.optimization.splitChunks = {
  //     chunks: "all",
  //     minSize: 20000,
  //     maxSize: 244000,
  //     cacheGroups: {
  //       default: {
  //         minChunks: 1,
  //         priority: -20,
  //         reuseExistingChunk: true,
  //       },
  //       vendors: {
  //         test: /[\\/]node_modules[\\/]/,
  //         priority: -10,
  //         reuseExistingChunk: true,
  //       },
  //     },
  //   };

  //   return config;
  // },
};
export default nextConfig;
