/** @type {import('next').NextConfig} */
const nextConfig = {
  output: 'standalone',
  skipTrailingSlashRedirect: true,
  images: {
    unoptimized: false,
    domains: ['www.qrmaster.net', 'qrmaster.net', 'images.qrmaster.net'],
    formats: ['image/webp', 'image/avif'],
    deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
    imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
  },
  experimental: {
    serverComponentsExternalPackages: ['@prisma/client', 'bcryptjs'],
  },
  // Allow build to succeed even with prerender errors
  // Pages with useSearchParams() will be rendered dynamically at runtime
  staticPageGenerationTimeout: 120,
  onDemandEntries: {
    maxInactiveAge: 25 * 1000,
    pagesBufferLength: 2,
  },
  poweredByHeader: false,
  async redirects() {
    return [
      {
        source: '/blog/bulk-qr-codes-excel',
        destination: '/blog/bulk-qr-code-generator-excel',
        permanent: true,
      },

    ];
  },
};

export default nextConfig;
