-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.mjs
65 lines (60 loc) · 1.82 KB
/
next.config.mjs
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import mdx from "@next/mdx";
import remarkMdxTocWithSlugs from "@altano/remark-mdx-toc-with-slugs";
import remarkGfm from "remark-gfm";
import rehypeSlug from "rehype-slug";
import remarkSectionize from "remark-sectionize";
import remarkMdxImages from "remark-mdx-images";
import remarkFrontmatter from "remark-frontmatter";
import remarkMdxFrontmatter from "remark-mdx-frontmatter";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import bundleAnalyzer from "@next/bundle-analyzer";
import rehypeMdxCodeProps from "rehype-mdx-code-props";
import remarkSmartypants from "remark-smartypants";
import remarkFootnotes from "remark-footnotes";
const withBundleAnalyzer = bundleAnalyzer({
enabled: process.env.ANALYZE === "true",
});
const withMDX = mdx({
extension: /\.mdx?$/,
options: {
remarkPlugins: [
[remarkMdxTocWithSlugs, { name: "tableOfContents" }],
remarkGfm,
remarkSmartypants,
remarkFootnotes,
remarkSectionize,
remarkFrontmatter,
remarkMdxFrontmatter,
remarkMdxImages,
],
rehypePlugins: [
rehypeSlug,
[
rehypeAutolinkHeadings,
{
behavior: "wrap",
properties: {
className: "auto-link-toc-anchor",
},
},
],
rehypeMdxCodeProps,
],
// If you use `MDXProvider`, uncomment the following line.
// providerImportSource: "@mdx-js/react",
},
});
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "export",
pageExtensions: ["ts", "tsx", "js", "jsx", "md", "mdx"],
images: {
// TODO Can we optimize images with export somehow? Check out next-optimized-images npm package
unoptimized: true,
},
reactStrictMode: true,
images: {
formats: ["image/avif", "image/webp"],
},
};
export default withBundleAnalyzer(withMDX(nextConfig));