-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathnext.config.mjs
44 lines (38 loc) · 1.09 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
import process from 'node:process';
Object.assign(process.env, { NEXT_TELEMETRY_DISABLED: '1' });
/**
* @typedef {import('next').NextConfig} NextConfig
* @typedef {Array<((config: NextConfig) => NextConfig)>} NextConfigPlugins
*/
import nextMDX from '@next/mdx';
import rehypeSlug from 'rehype-slug';
import rehypePrettyCode from 'rehype-pretty-code';
import moonlightTheme from './assets/moonlight-ii.json' with { type: 'json' };
/** @type {NextConfigPlugins} */
const plugins = [];
/** @type {NextConfig} */
const nextConfig = {
output: 'export',
cleanDistDir: true,
reactStrictMode: true,
poweredByHeader: false,
pageExtensions: ['md', 'mdx', 'tsx', 'ts', 'jsx', 'js'],
env: {
NEXT_TELEMETRY_DISABLED: '1',
},
};
/** @type {import('rehype-pretty-code').Options} */
const options = {
keepBackground: false,
theme: moonlightTheme,
};
plugins.push(
nextMDX({
extension: /\.(md|mdx)$/,
options: {
remarkPlugins: [],
rehypePlugins: [[rehypePrettyCode, options], rehypeSlug],
},
}),
);
export default () => plugins.reduce((_, plugin) => plugin(_), nextConfig);