1
+ import createWithBundleAnalyzer from "@next/bundle-analyzer" ;
2
+ import { withSentryConfig } from "@sentry/nextjs" ;
3
+ import type { RemotePattern } from "next/dist/shared/lib/image-config" ;
4
+ import type { NextConfig } from "next/types" ;
5
+
1
6
const cdnUri = process . env . NEXT_PUBLIC_CDN_URI != null ? new URL ( "/" , process . env . NEXT_PUBLIC_CDN_URI ) : undefined ;
2
7
3
- const DOCS_FILES_ALLOWLIST = [
8
+ const DOCS_FILES_ALLOWLIST : RemotePattern [ ] = [
4
9
{
5
10
protocol : "https" ,
6
11
hostname : "fdr-prod-docs-files.s3.us-east-1.amazonaws.com" ,
@@ -23,7 +28,7 @@ const DOCS_FILES_ALLOWLIST = [
23
28
} ,
24
29
] ;
25
30
26
- function isTruthy ( value ) {
31
+ function isTruthy ( value : string | undefined ) {
27
32
if ( value == null ) {
28
33
return false ;
29
34
} else if ( typeof value === "string" ) {
@@ -42,8 +47,7 @@ if (isTruthy(process.env.TRAILING_SLASH)) {
42
47
SENTRY_TUNNEL_ROUTE += "/" ;
43
48
}
44
49
45
- /** @type {import('next').NextConfig } */
46
- const nextConfig = {
50
+ const nextConfig : NextConfig = {
47
51
reactStrictMode : true ,
48
52
transpilePackages : [
49
53
"next-mdx-remote" ,
@@ -147,18 +151,14 @@ const nextConfig = {
147
151
} ,
148
152
} ;
149
153
150
- const withBundleAnalyzer = require ( "@next/bundle-analyzer" ) ( {
154
+ const withBundleAnalyzer = createWithBundleAnalyzer ( {
151
155
enabled : isTruthy ( process . env . ANALYZE ) ,
152
156
} ) ;
153
157
154
- module . exports = withBundleAnalyzer ( nextConfig ) ;
155
-
156
158
// Injected content via Sentry wizard below
157
159
158
- const { withSentryConfig } = require ( "@sentry/nextjs" ) ;
159
-
160
- module . exports = withSentryConfig (
161
- module . exports ,
160
+ export default withSentryConfig (
161
+ withBundleAnalyzer ( nextConfig ) ,
162
162
{
163
163
// For all available options, see:
164
164
// https://github.com/getsentry/sentry-webpack-plugin#options
0 commit comments