-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.js
79 lines (72 loc) · 1.74 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
const host =
process.env.REPLAY_DEVTOOLS_HOST || "https://dc3tvimjwmdjm.cloudfront.net";
const directories = ["dist", "images", "downloads", "driver", "protocol"];
const rewrites = [];
const headers = [];
rewrites.push({
source: `/protocol/tot/:domain`,
destination: `${host}/protocol/tot/:domain/`
});
rewrites.push({
source: "/discord",
destination: "https://discord.gg/PFjtU3uv7M"
});
const careersPage =
"https://www.notion.so/replayio/Replay-is-Hiring-2459455b1ab1446da7f1458721ba128f";
rewrites.push({
source: "/jobs",
destination: careersPage
});
rewrites.push({
source: "/careers",
destination: careersPage
});
for (const directory of directories) {
headers.push({
source: `/${directory}/:rest*`,
headers: [{ key: "cache-control", value: "s-maxage=1" }]
});
rewrites.push({
source: `/${directory}/:rest*`,
destination: `${host}/${directory}/:rest*`
});
}
module.exports = {
productionBrowserSourceMaps: true,
rewrites() {
return rewrites;
},
redirects() {
return [
{
source: "/demo",
destination: "/",
permanent: true
},
{
source: "/view/:slug*",
destination: "https://app.replay.io/:slug*",
permanent: true
},
{
source: `/browser/:rest*`,
destination: `https://app.replay.io/browser/:rest*`,
permanent: true
},
// [ryanjduffy] FIXME: Temporary redirects for browser pages
{
source: `/welcome-to-replay`,
destination: `https://app.replay.io/browser/welcome`,
permanent: true
},
{
source: `/new-tab`,
destination: `https://app.replay.io/browser/new-tab`,
permanent: true
}
];
},
headers() {
return headers;
}
};