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
This commit is contained in:
parent
3fb493f400
commit
cbfaee0771
3 changed files with 7 additions and 10 deletions
|
|
@ -1,11 +1,14 @@
|
|||
import withBundleAnalyzer from "@next/bundle-analyzer"
|
||||
import withPlugins from "next-compose-plugins"
|
||||
import { env } from "./env.mjs"
|
||||
|
||||
const plugins = [
|
||||
withBundleAnalyzer({ enabled: env.ANALYZE }),
|
||||
];
|
||||
|
||||
/**
|
||||
* @type {import('next').NextConfig}
|
||||
*/
|
||||
const config = withPlugins([[withBundleAnalyzer({ enabled: env.ANALYZE })]], {
|
||||
const config = {
|
||||
reactStrictMode: true,
|
||||
logging: {
|
||||
fetches: {
|
||||
|
|
@ -21,6 +24,6 @@ const config = withPlugins([[withBundleAnalyzer({ enabled: env.ANALYZE })]], {
|
|||
{ source: "/ping", destination: "/api/health" },
|
||||
]
|
||||
},
|
||||
})
|
||||
};
|
||||
|
||||
export default config
|
||||
export default plugins.reduce((acc, next) => next(acc), config);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue