Files
medusa-store/www/apps/user-guide/next.config.mjs
Shahed Nasser bf18d73ff4 docs: fix complete cart workflow usage in marketplace recipe (#9771)
- Fix usage of `completeCartWorkflow` which now returns an ID instead of the full order
- other: improvements in config across projects
2024-10-25 08:53:42 +00:00

87 lines
2.2 KiB
JavaScript

import mdx from "@next/mdx"
import rehypeMdxCodeProps from "rehype-mdx-code-props"
import rehypeSlug from "rehype-slug"
import remarkDirective from "remark-directive"
import remarkFrontmatter from "remark-frontmatter"
import {
brokenLinkCheckerPlugin,
localLinksRehypePlugin,
cloudinaryImgRehypePlugin,
resolveAdmonitionsPlugin,
crossProjectLinksPlugin,
} from "remark-rehype-plugins"
const withMDX = mdx({
extension: /\.mdx?$/,
options: {
rehypePlugins: [
// TODO add V2 to path if necessary
[
crossProjectLinksPlugin,
{
baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
projectUrls: {
docs: {
url: process.env.NEXT_PUBLIC_DOCS_URL,
path: "",
},
resources: {
url: process.env.NEXT_PUBLIC_RESOURCES_URL,
},
ui: {
url: process.env.NEXT_PUBLIC_UI_URL,
},
api: {
url: process.env.NEXT_PUBLIC_API_URL,
},
},
useBaseUrl:
process.env.NODE_ENV === "production" ||
process.env.VERCEL_ENV === "production",
},
],
[brokenLinkCheckerPlugin],
[localLinksRehypePlugin],
[
rehypeMdxCodeProps,
{
tagName: "code",
},
],
[rehypeSlug],
[
cloudinaryImgRehypePlugin,
{
cloudinaryConfig: {
cloudName: process.env.CLOUDINARY_CLOUD_NAME || "",
flags: ["fl_lossy", "f_auto"],
resize: {
action: "pad",
aspectRatio: "16:9",
},
roundCorners: 16,
},
},
],
],
remarkPlugins: [
[remarkFrontmatter],
[remarkDirective],
[resolveAdmonitionsPlugin],
],
jsx: true,
},
})
/** @type {import('next').NextConfig} */
const nextConfig = {
// Configure `pageExtensions` to include MDX files
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
transpilePackages: ["docs-ui"],
// TODO uncomment if we decide on baes path
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/user-guide",
}
export default withMDX(nextConfig)