import path from 'node:path';
import type { NextConfig } from 'next';

// One .env at the repo root serves web, game server and Prisma.
try {
  process.loadEnvFile(path.resolve(import.meta.dirname, '../../.env'));
} catch {
  // optional: production hosts inject env vars directly
}

const nextConfig: NextConfig = {
  reactStrictMode: true,
  poweredByHeader: false,
  transpilePackages: ['@pintrush/engine', '@pintrush/protocol', '@pintrush/db'],
  serverExternalPackages: ['pg', 'embedded-postgres', 'nodemailer'],
  turbopack: { root: path.resolve(import.meta.dirname, '../..') },
};

export default nextConfig;
