import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  images: {
    remotePatterns: [
      {
        protocol: "https",
        hostname: "avatars.githubusercontent.com",
      },
      {
        protocol: "https",
        hostname: "seccdn.libravatar.org",
      },
      {
        protocol: "http",
        hostname: "localhost",
      },
    ],
  },
  webpack(config, { isServer }) {
    if (isServer) {
      config.module.rules.push({
        test: /\.node$/,
        use: "node-loader",
      });
    }
    return config;
  },
};

export default nextConfig;
