mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### What? This fixes a couple of things: - Although it’s rare for MDX plugins to accept more than 1 option, they may accept any number of arguments. - In addition to `remarkPlugins` and `rehypePlugins`, now `recmaPlugins` is also patched to accept strings - TypeScript property Descriptions are preserved for patched values. ### Why? Because it is broken. ### How? Fixes #77297
25 lines
564 B
TypeScript
25 lines
564 B
TypeScript
import nextMDX from '@next/mdx'
|
|
const withMDX = nextMDX({
|
|
extension: /\.mdx?$/,
|
|
options: {
|
|
remarkPlugins: ['remark-gfm', ['remark-toc', { heading: 'The Table' }]],
|
|
rehypePlugins: [
|
|
'rehype-slug',
|
|
['rehype-katex', { strict: true, throwOnError: true }],
|
|
],
|
|
recmaPlugins: ['recma-export-filepath'],
|
|
},
|
|
})
|
|
|
|
/**
|
|
* @type {import('next').NextConfig}
|
|
*/
|
|
const nextConfig = {
|
|
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'mdx'],
|
|
experimental: {
|
|
mdxRs: process.env.WITH_MDX_RS === 'true',
|
|
},
|
|
}
|
|
|
|
export default withMDX(nextConfig)
|