import type { NextConfig } from 'next'

const nextConfig: NextConfig = {
  output: 'standalone',
  compress: false, // Disable gzip — local Electron app doesn't need compression, and it buffers SSE streams
  images: {
    unoptimized: true,
  },
  devIndicators: false,
  serverExternalPackages: ['better-sqlite3', 'drizzle-orm', '@larksuiteoapi/node-sdk'],
  // 2GB 内存服务器：build 时 tsc/ESLint 全量检查会 OOM（v8 堆触顶 ~1GB）。
  // 类型安全交给独立 `pnpm typecheck` 在本地/CI 跑，build 只做编译打包。
  typescript: { ignoreBuildErrors: true },
  eslint: { ignoreDuringBuilds: true },
  env: {
    NEXT_PUBLIC_AUTH_MODE: process.env.AUTH_MODE || 'international',
  },
}

export default nextConfig
