-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.mjs
52 lines (49 loc) · 1.21 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
import createMDX from '@next/mdx'
import remarkGfm from 'remark-gfm'
import rehypeToc from '@jsdevtools/rehype-toc'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
import rehypeSlug from 'rehype-slug'
import rehypePrism from 'rehype-prism-plus'
import rehypeCodeTitles from 'rehype-code-titles'
const ContentSecurityPolicy = `
connect-src 'self' vitals.vercel-insights.com
`
/** @type {import('next').NextConfig} */
const nextConfig = {
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'mdx', 'md'],
reactStrictMode: true,
experimental: {
appDir: true,
// mdxRs: false,
},
sassOptions: {
includePaths: ['./src'],
},
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'Content-Security-Policy',
value: ContentSecurityPolicy.replace(/\s{2,}/g, ' ').trim(),
},
],
},
]
},
}
const withMDX = createMDX({
extension: /\.mdx?$/,
options: {
remarkPlugins: [remarkGfm],
rehypePlugins: [
[rehypeCodeTitles],
[rehypePrism, { ignoreMissing: true, showLineNumbers: true }],
rehypeSlug,
rehypeAutolinkHeadings,
rehypeToc,
],
},
})
export default withMDX(nextConfig)