-
Notifications
You must be signed in to change notification settings - Fork 3
/
next.config.mjs
71 lines (67 loc) · 1.42 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
59
60
61
62
63
64
65
66
67
68
69
70
import gfm from 'remark-gfm';
import prism from 'remark-prism';
import smartypants from 'remark-smartypants';
import math from 'remark-math';
import katex from 'rehype-katex';
import withMDX from '@next/mdx';
const securityHeaders = [
{
key: 'X-DNS-Prefetch-Control',
value: 'on',
},
{
key: 'X-XSS-Protection',
value: '1; mode=block',
},
{
key: 'X-Frame-Options',
value: 'SAMEORIGIN',
},
{
key: 'Permissions-Policy',
value: 'accelerometer=(), autoplay=(), camera=(), cross-origin-isolated=(), display-capture=(), document-domain=(), encrypted-media=(), fullscreen=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), midi=(), payment=(), picture-in-picture=(), publickey-credentials-get=(), screen-wake-lock=(), sync-xhr=(), usb=(), xr-spatial-tracking=()',
},
{
key: 'X-Content-Type-Options',
value: 'nosniff',
},
{
key: 'Referrer-Policy',
value: 'no-referrer',
},
{
key: 'Sec-GPC',
value: '1',
},
];
const nextConfig = {
reactStrictMode: true,
experimental: {
optimizeCss: true,
},
poweredByHeader: false,
async headers() {
return [
{
source: '/(.*)',
headers: securityHeaders,
},
];
},
pageExtensions: ['tsx', 'ts', 'jsx', 'js', 'md', 'mdx'],
};
export default withMDX({
extension: /\.mdx?$/,
options: {
providerImportSource: '@mdx-js/react',
remarkPlugins: [
gfm,
smartypants,
prism,
math,
],
rehypePlugins: [
katex,
],
},
})(nextConfig);