-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
74 lines (61 loc) · 2.41 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
const { withSentryConfig } = require("@sentry/nextjs");
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
i18n: {
// These are all the locales you want to support in
// your application
locales: ["en", "en-US", "es", "es-MX", "fr-FR", "pt-BR"],
// This is the default locale you want to be used when visiting
// a non-locale prefixed path e.g. `/hello`
defaultLocale: "en-US",
localeDetection: false
},
//Added "page.tsx", "page.ts" to get middleware.page.ts working
// https://github.com/vercel/next.js/issues/38233#issuecomment-1172457237
pageExtensions: ["tsx", "page.tsx", "page.ts"],
publicRuntimeConfig: {
TxNativePublicToken: process.env.TRANSIFEX_TOKEN
},
images: { domains: process.env.IMAGE_DOMAINS?.split(",") ?? ["s3-eu-west-1.amazonaws.com"] },
// webpack5: true,
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
use: ["@svgr/webpack", "url-loader"]
});
config.resolve.fallback = {
...config.resolve.fallback,
fs: false
};
return config;
},
transpilePackages: ["mapbox-gl-draw-circle"]
};
/** @type {import('@sentry/nextjs').SentryWebpackPluginOptions} */
const userSentryWebpackPluginOptions = {
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options
// Suppresses source map uploading logs during build
silent: true,
org: process.env.SENTRY_ORG ?? "wri-terramatch",
project: process.env.SENTRY_PROJECT ?? "terramatch-frontend",
authToken: process.env.SENTRY_AUTH_TOKEN
};
/** @type {import('@sentry/nextjs').UserSentryOptions} */
const userSentryOptions = {
// 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: true,
// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true
};
module.exports = withSentryConfig(nextConfig, userSentryWebpackPluginOptions, userSentryOptions);