-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
51 lines (48 loc) · 1.21 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
44
45
46
47
48
49
50
51
import withMdx from '@next/mdx';
import BundleAnalyzer from '@next/bundle-analyzer';
import rehypePrettyCode from 'rehype-pretty-code';
import rehypeKatex from 'rehype-katex';
import remarkMath from 'remark-math';
import {
createHighlighter,
createJavaScriptRegexEngine,
} from 'shiki';
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
pageExtensions: ['tsx', 'mdx', 'ts'],
compiler: {
removeConsole: process.env.NODE_ENV === 'production' && {
exclude: ['error', 'warn'],
},
},
experimental: {
typedRoutes: true,
},
};
const withBundleAnalyzer = BundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
});
export default withBundleAnalyzer(
withMdx({
options: {
remarkPlugins: [remarkMath],
rehypePlugins: [
rehypeKatex,
[
rehypePrettyCode,
/** @type {Partial<import("rehype-pretty-code").Options>} */
({
theme: 'one-dark-pro',
createHighlighter: (options) => {
createHighlighter({
...options,
engine: createJavaScriptRegexEngine(),
});
},
}),
],
],
},
})(nextConfig),
);