import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  output: 'standalone',
  images: {
    loader: 'custom',
    loaderFile: './lib/openinary-loader.ts',
    remotePatterns: [
      {
        protocol: 'https',
        hostname: 'images.unsplash.com',
      },
      {
        protocol: 'https',
        hostname: 'lh3.googleusercontent.com',
      },
      {
        protocol: 'https',
        hostname: 'res.cloudinary.com',
      },
      {
        protocol: 'https',
        hostname: 'media.ayris.tech',
      },
    ],
  },
  async rewrites() {
      return [
          {
              source: '/media-proxy/:path*',
              destination: 'https://media.ayris.tech/:path*',
          },
      ];
  },
};

export default nextConfig;
