next-enterprise/next.config.mjs
Сидорук Сергій Віталійович cbfaee0771 fix(deps): eliminate next-compose-plugins
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
2024-12-11 22:29:01 +02:00

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);