-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
32 lines (28 loc) · 1020 Bytes
/
next.config.mjs
File metadata and controls
32 lines (28 loc) · 1020 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
27
28
29
30
31
32
// next.config.mjs, implemented with @next/mdx, serves for `import` of *.MDX
import createMDX from "@next/mdx";
// import rehypePrettyCode from "rehype-pretty-code";
// import remarkGfm from "remark-gfm";
// import rehypePrettyCode from "rehype-pretty-code";
// From Next v16+, import packages no longer required hence call as string under [options]
/** @type {import('rehype-pretty-code').Options} */
const prettyOptions = {
theme: "github-dark",
keepBackground: true,
};
const withMDX = createMDX({
options: {
remarkPlugins: ["remark-gfm"],
rehypePlugins: [["rehype-pretty-code", prettyOptions], "rehype-slug", "rehype-autolink-headings"],
},
extension: /\.mdx?$/,
});
/** @type {import('next').NextConfig} */
const nextConfig = {
// mdxRs MUST be FALSE for remark/rehype plugins to work
experimental: { mdxRs: false },
pageExtensions: ["js", "jsx", "md", "mdx", "ts", "tsx"],
output: "export",
distDir: "dist",
images: { unoptimized: true },
};
export default withMDX(nextConfig);