/[sudobot]/trunk/docs/next.config.mjs
ViewVC logotype

Contents of /trunk/docs/next.config.mjs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 575 - (show annotations)
Mon Jul 29 17:59:26 2024 UTC (8 months ago) by rakinar2
File MIME type: text/javascript
File size: 1223 byte(s)
chore: add trunk
1 import rehypePrism from "@mapbox/rehype-prism";
2 import createMDX from "@next/mdx";
3 import rehypeAutolinkHeadings from "rehype-autolink-headings";
4 import rehypeSlug from "rehype-slug";
5 import remarkFrontmatter from "remark-frontmatter";
6 import remarkGfm from "remark-gfm";
7 import remarkMdxFrontmatter from "remark-mdx-frontmatter";
8
9 /** @type {import('next').NextConfig} */
10 const nextConfig = {
11 pageExtensions: ["js", "jsx", "mdx", "ts", "tsx", "md"],
12 async rewrites() {
13 return [{ source: "/:path*.(mdx?)", destination: "/:path*" }];
14 },
15 };
16
17 const withMDX = createMDX({
18 extension: /\.mdx?$/,
19 options: {
20 remarkPlugins: [
21 remarkGfm,
22 remarkFrontmatter,
23 [remarkMdxFrontmatter, { name: "metadata" }],
24 ],
25 rehypePlugins: [
26 rehypeSlug,
27 [
28 rehypeAutolinkHeadings,
29 {
30 behavior: "append",
31 properties: { className: "autolink", tabindex: -1 },
32 },
33 ],
34 rehypePrism,
35 ],
36 },
37 webpack(config) {
38 require("./generate-sitemap.js");
39 return config;
40 },
41 });
42
43 export default withMDX(nextConfig);

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26