Files
medusa-store/www/apps/api-reference/next.config.mjs
Shahed Nasser 938f3bd934 docs: update to next 15 + eslint 9 (#9839)
* update next

* updated react

* update eslint

* finish updating eslint

* fix content lint errors

* fix docs test

* fix vale action

* fix installation errors
2024-11-13 17:03:17 +02:00

48 lines
1.1 KiB
JavaScript

import createMDX from "@next/mdx"
import bundleAnalyzer from "@next/bundle-analyzer"
import rehypeMdxCodeProps from "rehype-mdx-code-props"
import rehypeSlug from "rehype-slug"
/** @type {import('next').NextConfig} */
const nextConfig = {
// Configure `pageExtensions` to include MDX files
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/api",
webpack: (config) => {
config.ignoreWarnings = [{ module: /node_modules\/keyv\/src\/index\.js/ }]
return config
},
transpilePackages: ["docs-ui"],
async redirects() {
return [
{
source: "/api/download/:path",
destination: "/download/:path",
permanent: true,
},
]
},
}
const withMDX = createMDX({
options: {
rehypePlugins: [
[
rehypeMdxCodeProps,
{
tagName: "code",
},
],
[rehypeSlug],
],
development: process.env.NODE_ENV === "development",
},
})
const withBundleAnalyzer = bundleAnalyzer({
enabled: process.env.ANALYZE_BUNDLE === "true",
})
export default withMDX(nextConfig)