-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnext.config.ts
67 lines (54 loc) · 1.27 KB
/
next.config.ts
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
import { withSentryConfig } from "@sentry/nextjs";
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
output: "standalone",
experimental: {
staleTimes: {
dynamic: 30,
static: 60,
},
},
async rewrites() {
return [
{
source: "/zastepstwa",
destination: "/substitutions",
},
];
},
webpack: (config) => {
checkEnvVariables(["NEXT_PUBLIC_TIMETABLE_URL", "NEXT_PUBLIC_APP_URL"]);
return config;
},
};
const checkEnvVariables = (envVars: string[]) => {
envVars.forEach((envVar) => {
const value = process.env[envVar];
if (!value) {
throw new Error(
`Error: Missing required environment variable: ${envVar}`,
);
}
if (envVar.endsWith("_URL")) {
try {
new URL(value);
} catch {
throw new Error(
`Error: Environment variable ${envVar} is not a valid URL: ${value}`,
);
}
}
});
};
// export default nextConfig;
const sentryConfig = {
org: "majrvy",
project: "zstio-timetable",
silent: !process.env.CI,
widenClientFileUpload: true,
hideSourceMaps: true,
disableLogger: true,
automaticVercelMonitors: false,
telemetry: false,
};
export default withSentryConfig(nextConfig, sentryConfig);