1
1
import bundleAnalyze from "@next/bundle-analyzer" ;
2
2
import nextMDX from "@next/mdx" ;
3
3
import { withSentryConfig } from "@sentry/nextjs" ;
4
+ import { type NextConfig } from "next" ;
4
5
import nextRoutes from "nextjs-routes/config" ;
5
6
import path from "node:path" ;
6
7
import * as url from "node:url" ;
@@ -20,23 +21,25 @@ if (MONOREPO_MODE) {
20
21
console . log ( "- info Running with webpack aliases for monorepo compatibility" ) ;
21
22
}
22
23
23
- const resolvePackage = ( packageName ) => path . resolve ( __dirname , "." , "node_modules" , packageName ) ;
24
+ const resolvePackage = ( packageName : string ) =>
25
+ path . resolve ( __dirname , "." , "node_modules" , packageName ) ;
24
26
25
27
/**
26
28
* @type {import('next').NextConfig }
27
29
*/
28
- let nextConfig = {
29
- output : process . env . OUTPUT_TYPE ,
30
- generateBuildId : process . env . GIT_SHA ? ( ) => process . env . GIT_SHA : undefined ,
31
- typescript : { ignoreBuildErrors : process . env . SKIP_CHECKS } ,
32
- eslint : { ignoreDuringBuilds : process . env . SKIP_CHECKS } ,
30
+ let nextConfig : NextConfig = {
31
+ output : process . env . OUTPUT_TYPE as NextConfig [ "output" ] ,
32
+ generateBuildId : process . env . GIT_SHA ? ( ) => process . env . GIT_SHA ?? null : undefined ,
33
+ typescript : { ignoreBuildErrors : ! ! process . env . SKIP_CHECKS } ,
34
+ eslint : { ignoreDuringBuilds : ! ! process . env . SKIP_CHECKS } ,
33
35
// reactStrictMode: true, // TODO: Blocked by @rjsf Form using UNSAFE_componentWillReceiveProps
34
36
pageExtensions : [ "js" , "ts" , "jsx" , "tsx" , "mdx" ] ,
35
37
// replace empty string with undefined
36
38
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
37
39
basePath : process . env . NEXT_PUBLIC_BASE_PATH || undefined ,
38
40
transpilePackages : MONOREPO_MODE ? [ "@squonk/mui-theme" , "@squonk/sdf-parser" ] : [ ] ,
39
41
sassOptions : {
42
+ silenceDeprecations : [ "legacy-js-api" ] ,
40
43
prependData : `$assetsURL: "${ process . env . ASSET_URL ?? "https://squonk.informaticsmatters.org" } ";` ,
41
44
} ,
42
45
images : {
@@ -65,27 +68,14 @@ const withBundleAnalyser = bundleAnalyze({
65
68
nextConfig = withBundleAnalyser ( nextConfig ) ;
66
69
nextConfig = withMDX ( nextConfig ) ;
67
70
nextConfig = withRoutes ( nextConfig ) ;
68
- nextConfig = withSentryConfig (
69
- nextConfig ,
70
- {
71
- // For all available options, see:
72
- // https://github.com/getsentry/sentry-webpack-plugin#options
71
+ nextConfig = withSentryConfig ( nextConfig , {
72
+ // For all available options, see:
73
+ // https://github.com/getsentry/sentry-webpack-plugin#options
73
74
74
- // Suppresses source map uploading logs during build
75
- silent : true ,
76
- org : "informatics-matters" ,
77
- project : "data-manager-ui" ,
78
- } ,
79
- {
80
- // Upload a larger set of source maps for prettier stack traces (increases build time)
81
- widenClientFileUpload : true ,
82
- // Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
83
- tunnelRoute : "/monitoring" ,
84
- // Hides source maps from generated client bundles
85
- hideSourceMaps : true ,
86
- // Automatically tree-shake Sentry logger statements to reduce bundle size
87
- disableLogger : true ,
88
- } ,
89
- ) ;
75
+ // Suppresses source map uploading logs during build
76
+ silent : true ,
77
+ org : "informatics-matters" ,
78
+ project : "data-manager-ui" ,
79
+ } ) ;
90
80
91
81
export default nextConfig ;
0 commit comments