-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnext.config.mjs
More file actions
26 lines (22 loc) · 687 Bytes
/
next.config.mjs
File metadata and controls
26 lines (22 loc) · 687 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { remarkCodeHike, recmaCodeHike } from "codehike/mdx"
import createMDX from "@next/mdx"
/** @type {import('next').NextConfig} */
const nextConfig = {
// Configure `pageExtensions`` to include MDX files
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
// Optionally, add any other Next.js config below
}
/** @type {import('codehike/mdx').CodeHikeConfig} */
const chConfig = {
components: { code: "Code" },
}
const withMDX = createMDX({
extension: /\.mdx?$/,
options: {
remarkPlugins: [[remarkCodeHike, chConfig]],
recmaPlugins: [[recmaCodeHike, chConfig]],
jsx: true,
},
})
// Merge MDX config with Next.js config
export default withMDX(nextConfig)