-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.mjs
32 lines (29 loc) · 833 Bytes
/
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
import fs from 'node:fs';
import nextMDX from '@next/mdx';
import rehypePrettyCode from 'rehype-pretty-code';
import remarkGfm from 'remark-gfm';
import remarkEmoji from 'remark-emoji';
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
serverActions: true,
},
pageExtensions: ['js', 'jsx', 'mdx', 'ts', 'tsx'],
webpack: (config) => {
// https:/atomiks/rehype-pretty-code/issues/128
config.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto',
});
return config;
},
};
const withMDX = nextMDX({
extension: /\.mdx?$/,
options: {
remarkPlugins: [remarkGfm, [remarkEmoji, { accessible: true }]],
rehypePlugins: [[rehypePrettyCode, { theme: 'dark-plus' }]],
},
});
export default withMDX(nextConfig);