-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.mjs
49 lines (45 loc) · 1.34 KB
/
next.config.mjs
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
import { createRequire } from "module";
import { withSentryConfig } from "@sentry/nextjs";
import withBundleAnalyzer from "@next/bundle-analyzer";
const require = createRequire(import.meta.url);
/**
* @type {import('next').NextConfig}
*/
const baseConfig = {
basePath: "/stillinger",
reactStrictMode: true,
cacheHandler: process.env.NODE_ENV === "production" ? require.resolve("./cache-handler.mjs") : undefined,
transpilePackages: ["@navikt/arbeidsplassen-react"],
experimental: {
optimizePackageImports: ["@navikt/ds-react", "@navikt/aksel-icons"],
instrumentationHook: true,
},
assetPrefix: process.env.ASSET_PREFIX || undefined,
output: "standalone",
eslint: {
ignoreDuringBuilds: true,
},
env: {
STILLINGSREGISTRERING_PATH: "/stillingsregistrering",
},
};
const withBundle = withBundleAnalyzer({
enabled: process.env.ANALYZE === "true",
});
// Konfigurer Sentry med bundle-analyzer
const nextConfig = withSentryConfig(
withBundle(baseConfig),
{
silent: true,
org: "nav",
project: "pam-stillingsok",
url: "https://sentry.gc.nav.no/",
authToken: process.env.SENTRY_AUTH_TOKEN,
},
{
widenClientFileUpload: true,
tunnelRoute: "/monitoring",
hideSourceMaps: true,
},
);
export default nextConfig;