-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.ts
More file actions
69 lines (63 loc) · 2.58 KB
/
Copy pathnext.config.ts
File metadata and controls
69 lines (63 loc) · 2.58 KB
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
import type { NextConfig } from "next";
const isDev: boolean = process.env.NODE_ENV === 'development';
const cspHeader: string = `
default-src 'self';
script-src 'self' 'unsafe-inline' 'unsafe-eval' https://challenges.cloudflare.com https://pagead2.googlesyndication.com https://ep2.adtrafficquality.google https://fonts.googleapis.com;
style-src 'self' 'unsafe-inline' https://fonts.googleapis.com;
img-src 'self' blob: data: https://cdn.discordapp.com https://i.imgur.com https://pagead2.googlesyndication.com https://ep1.adtrafficquality.google;
font-src 'self' https://fonts.gstatic.com https://fonts.googleapis.com;
object-src 'none';
base-uri 'self';
form-action 'self';
frame-ancestors 'none';
frame-src https://challenges.cloudflare.com https://pagead2.googlesyndication.com https://ep2.adtrafficquality.google https://f4f4a93ca9d0b19f388ece6c0641c694.safeframe.googlesyndication.com;
connect-src 'self' https://api.clank.dev https://pagead2.googlesyndication.com https://ep1.adtrafficquality.google ${isDev ? 'http://localhost:8081' : ''};
worker-src 'self' blob:;
upgrade-insecure-requests;
`;
const nextConfig: NextConfig = {
output: "standalone",
trailingSlash: true,
compress: true,
i18n: {
locales: ['de', 'en'],
defaultLocale: 'de'
},
images: {
formats: ['image/avif', 'image/webp'],
minimumCacheTTL: 31536000,
remotePatterns: [{ hostname: 'cdn.discordapp.com' }, { hostname: 'i.imgur.com' }],
},
experimental: {
optimizeCss: true,
turbopackMinify: true,
turbopackRemoveUnusedExports: true,
nextScriptWorkers: true,
optimizePackageImports: [
"animate.css"
]
},
async headers() {
return [
{
source: '/(.*)',
headers: [
{
key: 'Content-Security-Policy',
value: cspHeader.replace(/\s{2,}/g, ' ').trim()
},
],
},
];
},
async redirects() {
return [
{source: '/changelog', destination: '/discord/changelog', permanent: true},
{source: '/clank-bot', destination: '/discord/clank-bot', permanent: true},
{source: '/community', destination: '/discord/community', permanent: true},
{source: '/leaderboard', destination: '/discord/leaderboard', permanent: true},
{source: '/tech-coding', destination: '/discord/tech-coding', permanent: true},
]
},
};
export default nextConfig;