-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
96 lines (92 loc) · 2.6 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/* eslint-disable @typescript-eslint/no-var-requires */
const cspHeader = `
default-src 'self';
script-src 'self' https://vercel.live https://vercel.com *.vercel-scripts.com 'unsafe-inline' ${
process.env.NODE_ENV === "production" ? "" : `'unsafe-eval' localhost:*`
};
style-src 'self' https://vercel.live https://vercel.com 'unsafe-inline';
connect-src 'self' https://vercel.live https://vercel.com *.vercel-storage.com *.pusher.com *.pusherapp.com wss://ws-us3.pusher.com ${
process.env.NODE_ENV === "production"
? ""
: `localhost:* ws://localhost:*`
};
img-src 'self' https://vercel.live https://vercel.com https://avatar.vercel.sh *.pusher.com/ https://lh3.googleusercontent.com https://cdn.discordapp.com https://avatars.githubusercontent.com *.vercel-storage.com blob: data:;
frame-src 'self' https://vercel.live https://vercel.com;
font-src 'self' https://vercel.live https://assets.vercel.com;
object-src 'none';
base-uri 'self';
form-action 'self';
frame-ancestors 'none';
upgrade-insecure-requests;
`;
/** @type {import('next').NextConfig} */
const nextConfig = {
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
images: {
remotePatterns: [
{
protocol: "https",
hostname: "avatars.githubusercontent.com",
port: "",
pathname: "/u/**",
},
{
protocol: "https",
hostname: "lh3.googleusercontent.com",
port: "",
pathname: "/a/**",
},
{
protocol: "https",
hostname: "cdn.discordapp.com",
port: "",
pathname: "/**",
},
{
protocol: "https",
hostname: "avatar.vercel.sh",
port: "",
pathname: "/**",
},
{
protocol: "https",
hostname: "s2qw9udutrlis7qk.public.blob.vercel-storage.com",
port: "",
},
{
protocol: "https",
hostname: "lux.dev",
port: "",
},
],
},
async headers() {
return [
{
source: "/(.*)",
headers: [
{
key: "X-Frame-Options",
value: "SAMEORIGIN",
},
{
key: "Content-Security-Policy",
value: cspHeader.replace(/\n/g, ""),
},
{
key: "X-Content-Type-Options",
value: "nosniff",
},
],
},
];
},
};
const withVercelToolbar = require("@vercel/toolbar/plugins/next")();
const { withAxiom } = require("next-axiom");
module.exports = withAxiom(withVercelToolbar(nextConfig));