Unverified Commit 3a9e5327 authored by Steven's avatar Steven Committed by GitHub

Update mdx docs example to show merging config (#44656)

This PR updates the `@next/mdx` docs example code snippet to show merging config inside next.config.js

Related to comment https://github.com/vercel/next.js/pull/44205#issuecomment-1373714608
parent bd6a431b
...@@ -53,10 +53,17 @@ The following steps outline how to setup `@next/mdx` in your Next.js project: ...@@ -53,10 +53,17 @@ The following steps outline how to setup `@next/mdx` in your Next.js project:
// providerImportSource: "@mdx-js/react", // providerImportSource: "@mdx-js/react",
}, },
}) })
module.exports = withMDX({
// Append the default value with md extensions /** @type {import('next').NextConfig} */
const nextConfig = {
// Configure pageExtensions to include md and mdx
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'], pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
}) // Optionally, add any other Next.js config below
reactStrictMode: true,
}
// Merge MDX config with Next.js config
module.exports = withMDX(nextConfig)
``` ```
3. Create a new MDX page within the `/pages` directory: 3. Create a new MDX page within the `/pages` directory:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment