-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnext.config.js
55 lines (51 loc) · 1.36 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
/* eslint-disable @typescript-eslint/no-var-requires */
const csp = require("./csp");
const { withSentryConfig } = require("@sentry/nextjs");
const config = {
compiler: {
// ssr and displayName are configured by default
styledComponents: true,
},
basePath: "/arbeid",
productionBrowserSourceMaps: true,
output: "standalone",
publicRuntimeConfig: {
NEXT_PUBLIC_SENTRY_STAGE: process.env.NEXT_PUBLIC_SENTRY_STAGE,
},
i18n: {
locales: ["no", "en"],
defaultLocale: "no",
localeDetection: false, // vi har ikke bra nok engelsk språkstøtte til at dette er bra
},
async headers() {
return [
{
source: "/:path*",
headers: [
{
key: "Content-Security-Policy",
value: csp,
},
],
},
];
},
async redirects() {
return [
{
source: "/arbeidsledig-permittert",
destination: "https://www.nav.no/arbeidsledig-permittert",
permanent: true,
},
];
},
};
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options.
const sentryWebpackPluginOptions = {
silent: true, // Suppresses all logs
errorHandler: (err, invokeErr, compilation) => {
compilation.warnings.push("Sentry CLI Plugin: " + err.message);
},
};
module.exports = withSentryConfig(config, sentryWebpackPluginOptions);