-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.mjs
58 lines (53 loc) · 1.64 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
// @ts-check
import nextMdx from '@next/mdx'
import rehypePrettyCode from 'rehype-pretty-code'
// import rehypeHighlight from 'rehype-highlight'
// import typescript from 'highlight.js/lib/languages/typescript.js'
// import rehypePrism from '@mapbox/rehype-prism'
// import rehypePrism from 'rehype-prism-plus'
/**
* @link https://nextjs.org/docs/pages/building-your-application/configuring/mdx
*/
const withMDX = nextMdx({
extension: /\.(md|mdx)$/,
options: {
//providerImportSource: '@mdx-js/react', // TypeError: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it.
// https://nextjs.org/docs/app/building-your-application/configuring/mdx#remark-and-rehype-plugins
rehypePlugins: [
[
// https://rehype-pretty-code.netlify.app/
// https://github.com/atomiks/rehype-pretty-code
rehypePrettyCode,
{
keepBackground: false,
theme: {
// https://unpkg.com/browse/[email protected]/themes/
dark: 'github-dark',
light: 'github-light'
}
}
],
// [rehypeHighlight, {
// aliases: {typescript: 'tsx'},
// languages: {typescript}
// }]
// [
// // https://github.com/timlrx/rehype-prism-plus
// rehypePrism,
// {
// showLineNumbers: true
// }
// ]
]
}
})
/** @type {import('next').NextConfig} */
const nextConfig = {
// pageExtensions: ['ts', 'tsx', 'md', 'mdx'],
experimental: {
appDir: true,
//mdxRs: false // В настоящее время mdxRs не поддерживает плагины rehypePlugins. https://github.com/vercel/next.js/issues/46659
},
output: 'export',
}
export default withMDX(nextConfig)