forked from saleor/apps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
47 lines (42 loc) · 1.22 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
// @ts-check
import { withSentryConfig } from "@sentry/nextjs";
const isSentryPropertiesInEnvironment =
process.env.SENTRY_AUTH_TOKEN && process.env.SENTRY_PROJECT && process.env.SENTRY_ORG;
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
transpilePackages: [
"@saleor/apps-shared",
"@saleor/apps-ui",
"@saleor/react-hook-form-macaw",
"@saleor/apps-logger",
"@saleor/apps-otel",
],
experimental: {},
/*
* Ignore opentelemetry warnings - https://github.com/open-telemetry/opentelemetry-js/issues/4173
* Remove when https://github.com/open-telemetry/opentelemetry-js/pull/4660 is released
*/
/** @type {import('next').NextConfig['webpack']} */
webpack: (config, { isServer }) => {
if (isServer) {
config.ignoreWarnings = [{ module: /opentelemetry/ }];
}
return config;
},
};
const configWithSentry = withSentryConfig(
nextConfig,
{
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
silent: true,
},
{
hideSourceMaps: true,
widenClientFileUpload: true,
disableLogger: true,
tunnelRoute: "/monitoring",
},
);
export default isSentryPropertiesInEnvironment ? configWithSentry : nextConfig;