import type { NextConfig } from "next";

const basePath = process.env.NEXT_PUBLIC_BASE_PATH || "";

const nextConfig: NextConfig = {
  ...(basePath ? { basePath } : {}),
  experimental: {
    agentFeedback: true,
    optimizePackageImports: ["@mantine/core", "@mantine/hooks"],
  },
  ...(!basePath ? { cacheComponents: true, partialPrefetching: true } : {}),
  turbopack: {
    rules: {
      "*.css": {
        loaders: ["@tailwindcss/turbopack"],
        as: "*.css",
      },
    },
  },
};

export default nextConfig;
