-
Notifications
You must be signed in to change notification settings - Fork 8
/
next.config.js
72 lines (69 loc) · 1.64 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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: "",
},
{
key: "X-Content-Type-Options",
value: "nosniff",
},
{
key: "Referrer-Policy",
value: "origin-when-cross-origin",
},
{
key: "Content-Security-Policy",
value:
"default-src 'self' 'unsafe-eval'; " +
"script-src 'self' 'unsafe-inline' 'unsafe-eval' *.googletagmanager.com ; " +
"connect-src 'self' api.peterportal.org vitals.vercel-insights.com *.google-analytics.com *.analytics.google.com *.googletagmanager.com; " +
"style-src 'self' 'unsafe-inline' fonts.googleapis.com; " +
"font-src fonts.gstatic.com; " +
"img-src 'self' *.google-analytics.com *.googletagmanager.com data:;",
},
];
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
pageExtensions: ["js", "jsx", "ts", "tsx", "md", "mdx"],
webpack: (config, options) => {
config.module.rules.push({
test: /\.mdx?$/,
use: [
options.defaultLoaders.babel,
{
loader: "@mdx-js/loader",
/** @type {import('@mdx-js/loader').Options} */
options: {},
},
],
});
return config;
},
i18n: {
locales: ["en"],
defaultLocale: "en",
},
async headers() {
return [
{
// Apply these headers to all routes in your application.
source: "/:path*",
headers: securityHeaders,
},
];
},
};
module.exports = nextConfig;