/** @type {import('next').NextConfig} */

const path = require("path");
const { loadEnvConfig } = require("@next/env");

// Load .env* from this app directory. Required when the workspace root is wrong
// (e.g. multiple lockfiles) so ATHENA_AUTH_ORIGIN in ./.env.local is not ignored.
loadEnvConfig(path.dirname(__filename));
const workspaceRoot = path.resolve(__dirname, "..", "..");

const nextConfig = {
  reactStrictMode: true,
  transpilePackages: ["athena-auth-js", "athena-auth-ui-js"],
  outputFileTracingRoot: workspaceRoot,
  turbopack: {
    root: workspaceRoot,
  },
  async rewrites() {
    return [];
  },
};

module.exports = nextConfig;
