Files
medusa-store/www/apps/resources/next.config.mjs
Shahed Nasser 728c5ee53c docs: preparations for preview (#7267)
* configured base paths + added development banner

* fix typelist site url

* added navbar and sidebar badges

* configure algolia filters

* remove AI assistant

* remove unused imports

* change navbar text and badge

* lint fixes

* fix build error

* add to api reference rewrites

* fix build error

* fix build errors in user-guide

* fix feedback component

* add parent title to pagination

* added breadcrumbs component

* remove user-guide links

* resolve todos

* fix details about authentication

* change documentation title

* lint content
2024-05-13 11:32:52 +03:00

56 lines
1.3 KiB
JavaScript

import mdx from "@next/mdx"
import {
brokenLinkCheckerPlugin,
localLinksRehypePlugin,
typeListLinkFixerPlugin,
} from "remark-rehype-plugins"
import { slugChanges } from "./generated/slug-changes.mjs"
import mdxPluginOptions from "./mdx-options.mjs"
const withMDX = mdx({
extension: /\.mdx?$/,
options: {
rehypePlugins: [
...mdxPluginOptions.options.rehypePlugins,
[brokenLinkCheckerPlugin],
[localLinksRehypePlugin],
[typeListLinkFixerPlugin],
],
remarkPlugins: mdxPluginOptions.options.remarkPlugins,
jsx: true,
},
})
/** @type {import('next').NextConfig} */
const nextConfig = {
// Configure `pageExtensions` to include MDX files
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
transpilePackages: ["docs-ui"],
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/v2/resources",
async rewrites() {
return {
fallback: [
{
source: "/:path*",
destination: `${
process.env.NEXT_PUBLIC_DOCS_URL || "https://localhost:3001"
}/:path*`,
basePath: false,
},
],
}
},
async redirects() {
// redirect original file paths to the rewrite
return slugChanges.map((item) => ({
source: item.origSlug,
destination: item.newSlug,
permanent: true,
}))
},
}
export default withMDX(nextConfig)