import withMintelConfig from "@mintel/next-config"; import createMDX from "@next/mdx"; /** @type {import('next').NextConfig} */ const nextConfig = { pageExtensions: ["js", "jsx", "md", "mdx", "ts", "tsx"], async rewrites() { const umamiUrl = process.env.UMAMI_API_ENDPOINT || process.env.UMAMI_SCRIPT_URL || process.env.NEXT_PUBLIC_UMAMI_SCRIPT_URL || "https://analytics.infra.mintel.me"; const glitchtipUrl = process.env.SENTRY_DSN ? new URL(process.env.SENTRY_DSN).origin : "https://errors.infra.mintel.me"; return [ { source: "/stats/:path*", destination: `${umamiUrl}/:path*`, }, { source: "/:locale(de)/stats/:path*", destination: `${umamiUrl}/:path*`, }, { source: "/errors/:path*", destination: `${glitchtipUrl}/:path*`, }, { source: "/:locale(de)/errors/:path*", destination: `${glitchtipUrl}/:path*`, }, ]; }, }; const withMDX = createMDX({}); export default withMintelConfig(withMDX(nextConfig));