-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.js
43 lines (40 loc) · 1.04 KB
/
next.config.js
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
const withPlugins = require("next-compose-plugins");
const optimizedImages = require("next-optimized-images");
const withMdxEnhanced = require("next-mdx-enhanced");
const withFonts = require("next-fonts");
const readingTime = require("reading-time")
const nextConfig = {
pageExtensions: ["js", "jsx", "mdx", "tsx"],
};
const mdxEnhancedConfig = {
layoutPath: "src/layouts",
defaultLayout: true,
fileExtensions: ["mdx"],
remarkPlugins: [
[require("remark-toc"), {tight: true}]
],
rehypePlugins: [
require("rehype-slug"),
[require("rehype-autolink-headings"), {behavior: "wrap"}],
],
extendFrontMatter: {
process: (mdxContent, frontMatter) => {
return {
readingTime: readingTime(mdxContent).text
}
},
},
};
module.exports = withPlugins(
[
[
optimizedImages,
{
optimizeImages: false,
},
],
withFonts,
withMdxEnhanced(mdxEnhancedConfig),
],
nextConfig
);