import type { NextConfig } from "next";

import path from 'path';

const nextConfig: NextConfig = {
  /* config options here */
  output: 'standalone',
  webpack: (config) => {
    config.resolve.alias['@'] = path.resolve(__dirname);
    return config;
  },
  typescript: {
    ignoreBuildErrors: true,
  },
  eslint: {
    ignoreDuringBuilds: true,
  },
  // Note: Most API proxying is done via API routes in /app/auth/*, /app/api/*, /app/audit/*
  // Only static endpoints use rewrites
  async rewrites() {
    return [
      {
        source: '/docs',
        destination: 'http://backend:8000/docs',
      },
      {
        source: '/openapi.json',
        destination: 'http://backend:8000/openapi.json',
      }
    ];
  },
};

export default nextConfig;
