forked from zbycz/osmapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
47 lines (44 loc) · 1.82 KB
/
next.config.mjs
File metadata and controls
47 lines (44 loc) · 1.82 KB
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
// @ts-check
import { withSentryConfig } from '@sentry/nextjs';
import { LANGUAGES } from './src/config.mjs';
const osmappVersion = process.env.npm_package_version;
const commitHash = (process.env.VERCEL_GIT_COMMIT_SHA || '').substring(0, 7);
const commitMessage = process.env.VERCEL_GIT_COMMIT_MESSAGE || 'dev';
const sentryRelease = `${osmappVersion}-${commitHash}-${commitMessage.substring(0, 20)}`;
/** @type {import('next').NextConfig} */
const nextConfig = {
devIndicators: { position: 'bottom-right' },
allowedDevOrigins: ['127.0.0.1', 'localhost'],
compiler: {
emotion: true,
},
output: process.env.NEXTJS_OUTPUT || undefined,
env: { osmappVersion, sentryRelease },
i18n: {
locales: ['default', ...Object.keys(LANGUAGES)], // we let next only handle URL, but chosen locale is in getServerIntl()
defaultLocale: 'default',
localeDetection: false,
},
rewrites: () => {
if (typeof process.env.PROXY_BACKEND === 'undefined') {
return [];
}
return [
{
source: '/((?!node|way|relation|install|directions|-|[0-9])):path(.*)',
destination: process.env.PROXY_BACKEND + ':path',
},
];
},
};
export default withSentryConfig(nextConfig, {
org: 'osmapp', // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
project: 'osmapp',
silent: !process.env.CI,
widenClientFileUpload: true, // Upload a larger set of source maps for prettier stack traces (increases build time)
reactComponentAnnotation: { enabled: true }, // Automatically annotate React components to show their full name in breadcrumbs and session replay
// tunnelRoute: '/monitoring',
hideSourceMaps: false,
disableLogger: true, // Automatically tree-shake Sentry logger statements to reduce bundle size
automaticVercelMonitors: true, // https://vercel.com/docs/cron-jobs
});