Next.js v15 supports next.config.ts file, and there you will get an error about next-compose-plugins does not have `@types/next-compose-plugins`, so to not create file types with `declare module ...` for this specific problem it's easier to replace all the meaning of compose plugins with just a single `reduce` function. detailed explanation here: https://github.com/hashicorp/next-mdx-enhanced/issues/18#issuecomment-859196106
29 lines
693 B
JavaScript
29 lines
693 B
JavaScript
import withBundleAnalyzer from "@next/bundle-analyzer"
|
|
import { env } from "./env.mjs"
|
|
|
|
const plugins = [
|
|
withBundleAnalyzer({ enabled: env.ANALYZE }),
|
|
];
|
|
|
|
/**
|
|
* @type {import('next').NextConfig}
|
|
*/
|
|
const config = {
|
|
reactStrictMode: true,
|
|
logging: {
|
|
fetches: {
|
|
fullUrl: true,
|
|
},
|
|
},
|
|
experimental: { instrumentationHook: true },
|
|
rewrites() {
|
|
return [
|
|
{ source: "/healthz", destination: "/api/health" },
|
|
{ source: "/api/healthz", destination: "/api/health" },
|
|
{ source: "/health", destination: "/api/health" },
|
|
{ source: "/ping", destination: "/api/health" },
|
|
]
|
|
},
|
|
};
|
|
|
|
export default plugins.reduce((acc, next) => next(acc), config);
|