forked from discohook/site
-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
62 lines (57 loc) · 1.56 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
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable import/order */
const cp = require("child_process")
const config = {
target: "serverless",
poweredByHeader: false,
distDir: "build",
reactStrictMode: true,
productionBrowserSourceMaps: true,
generateBuildId: async () => {
if (process.env.BUILD_ID) return process.env.BUILD_ID
return new Promise((resolve, reject) => {
cp.execFile("git", ["rev-parse", "HEAD"], (error, stdout) => {
if (error) reject(error)
resolve(stdout)
})
})
},
redirects: async () =>
Promise.resolve([
{
source: "/discord",
destination: "https://discord.gg/dtPGCsm",
permanent: false,
},
{
source: "/bot",
destination:
"https://discord.com/oauth2/authorize?client_id=633565743103082527&permissions=805694528&scope=applications.commands+bot",
permanent: false,
},
]),
headers: async () =>
Promise.resolve([
{
source: "/(.*)",
headers: [
{
key: "Content-Security-Policy",
value: "upgrade-insecure-requests; frame-ancestors 'none';",
},
{
key: "Referrer-Policy",
value: "strict-origin-when-cross-origin",
},
{
key: "X-Content-Type-Options",
value: "nosniff",
},
],
},
]),
}
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
})
module.exports = withBundleAnalyzer(config)