-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
91 lines (82 loc) · 3.12 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
80
81
82
83
84
85
86
87
88
89
90
91
const { withSentryConfig } = require('@sentry/nextjs');
/**
* @type {import('next').NextConfig}
*/
const moduleExports = {
productionBrowserSourceMaps: true,
swcMinify: true,
async redirects() {
// Redirects to fix non-existing paths should go in `src/redirects.js`!!!
const env = process.env.NEXT_PUBLIC_ENVIRONMENT;
return [
{
source: '/',
destination: '/dashboard',
permanent: env !== 'development',
},
];
},
async rewrites() {
return [
{
source: '/robots.txt',
destination: '/api/robots',
},
];
},
publicRuntimeConfig: {
baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
environment: process.env.NEXT_PUBLIC_ENVIRONMENT,
apiKey: process.env.NEXT_PUBLIC_API_KEY,
apiUrl: process.env.NEXT_PUBLIC_API_URL,
authDomain:
process.env.NEXT_PUBLIC_KEYCLOAK_ENABLED === 'true'
? process.env.NEXT_PUBLIC_AUTH_DOMAIN
: process.env.NEXT_PUBLIC_LEGACY_AUTH_DOMAIN,
legacyAppUrl: process.env.NEXT_PUBLIC_LEGACY_APP_URL,
authUrl: process.env.NEXT_PUBLIC_AUTH_URL,
socketUrl: process.env.NEXT_PUBLIC_SOCKET_URL,
newAnnouncementsUrl: process.env.NEXT_PUBLIC_NEW_ANNOUNCEMENTS_URL,
taxonomyUrl: process.env.NEXT_PUBLIC_TAXONOMY_URL,
cultuurKuurLocationId: process.env.NEXT_PUBLIC_CULTUURKUUR_LOCATION_ID,
sentryDsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
newsletterApiUrl: process.env.NEXT_PUBLIC_NEWSLETTER_API_URL,
newsletterEmailListId: process.env.NEXT_PUBLIC_NEWSLETTER_EMAIL_LIST_ID,
globalAlertMessage: process.env.NEXT_PUBLIC_GLOBAL_ALERT_MESSAGE,
globalAlertVariant: process.env.NEXT_PUBLIC_GLOBAL_ALERT_VARIANT,
shouldShowBetaVersion: process.env.NEXT_PUBLIC_SHOULD_SHOW_BETA_VERSION,
hotjarEventName: process.env.NEXT_PUBLIC_HOTJAR_EVENT_NAME,
hotjarMissingFieldName: process.env.NEXT_PUBLIC_HOTJAR_MISSING_FIELD_NAME,
ownershipEnabled: process.env.NEXT_PUBLIC_OWNERSHIP_ENABLED,
imgixUrl: process.env.NEXT_PUBLIC_IMGIX_URL,
},
pageExtensions: ['page.tsx', 'page.js', 'api.ts'],
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
};
/** @type {Partial<import('@sentry/nextjs').SentryWebpackPluginOptions>} */
const SentryWebpackPluginOptions = {
silent: true,
org: 'publiq-vzw',
project: 'udb3-frontend',
authToken: process.env.SENTRY_AUTH_TOKEN,
};
module.exports.withoutSentry = moduleExports;
module.exports = withSentryConfig(moduleExports, SentryWebpackPluginOptions, {
// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,
// Transpiles SDK to be compatible with IE11 (increases bundle size)
transpileClientSDK: true,
// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
tunnelRoute: '/monitoring',
// Hides source maps from generated client bundles
hideSourceMaps: false,
// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
});