Skip to content

Commit

Permalink
wrong content for next.config.mjs for MDX Plugins (#52738)
Browse files Browse the repository at this point in the history
  • Loading branch information
s0h311 committed Jul 19, 2023
1 parent 7771e78 commit 20b115e
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,23 +243,27 @@ You can optionally provide `remark` and `rehype` plugins to transform the MDX co

Since the `remark` and `rehype` ecosystem is ESM only, you'll need to use `next.config.mjs` as the configuration file.

```js filename="next.config.js"
```js filename="next.config.mjs"
import remarkGfm from 'remark-gfm'
import createMDX from '@next/mdx'

/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
appDir: true,
},
}

const withMDX = require('@next/mdx')({
const withMDX = createMDX({
options: {
remarkPlugins: [],
extension: /\.mdx?$/,
remarkPlugins: [remarkGfm],
rehypePlugins: [],
// If you use `MDXProvider`, uncomment the following line.
// providerImportSource: "@mdx-js/react",
},
})
module.exports = withMDX(nextConfig)
export default withMDX(nextConfig)
```

## Frontmatter
Expand Down

0 comments on commit 20b115e

Please sign in to comment.