-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathnext.config.js
76 lines (69 loc) · 2.27 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
// This file sets a custom webpack configuration to use your Next.js app
// with Sentry.
// https://nextjs.org/docs/api-reference/next.config.js/introduction
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { withSentryConfig } = require("@sentry/nextjs");
// This file was automatically added by edgio init.
// You should commit this file to source control.
// const withEdgio = require("@edgio/next/withEdgio");
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
images: {
// All the images are served from the CF CDN, so we don't need to optimize them.
// It optimized already optimized images resulting in shit quality.
unoptimized: true,
},
experimental: {
// 256 kB should be OK
largePageDataBytes: 256 * 1024,
},
// Localization completely changes the url and we would need to re-write the cache routes
// In future we can look into it
// i18n: {
// locales: ["en"],
// defaultLocale: "en",
// },
async headers() {
return [
{
source: "/:path*",
headers: [
{
key: "Netlify-Vary",
value: "query",
},
],
},
];
},
};
// const withEdgioConfig = withEdgio({
// ...nextConfig,
// });
const sentryWebpackPluginOptions = {
// Additional config options for the Sentry Webpack plugin. Keep in mind that
// the following options are set automatically, and overriding them is not
// recommended:
// release, url, authToken, configFile, stripPrefix,
// urlPrefix, include, ignore
silent: true, // Suppresses all logs
hideSourceMaps: true,
org: "coh-stats",
project: "coh3-stats-web",
authToken: process.env.SENTRY_AUTH_TOKEN,
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options.
};
if (process.env.ANALYZE === "true") {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
});
module.exports = withBundleAnalyzer(nextConfig);
} else {
// Default config
module.exports = withSentryConfig(nextConfig, sentryWebpackPluginOptions);
}