11import bundleAnalyze from "@next/bundle-analyzer" ;
22import nextMDX from "@next/mdx" ;
33import { withSentryConfig } from "@sentry/nextjs" ;
4+ import { type NextConfig } from "next" ;
45import nextRoutes from "nextjs-routes/config" ;
56import path from "node:path" ;
67import * as url from "node:url" ;
@@ -20,23 +21,25 @@ if (MONOREPO_MODE) {
2021 console . log ( "- info Running with webpack aliases for monorepo compatibility" ) ;
2122}
2223
23- const resolvePackage = ( packageName ) => path . resolve ( __dirname , "." , "node_modules" , packageName ) ;
24+ const resolvePackage = ( packageName : string ) =>
25+ path . resolve ( __dirname , "." , "node_modules" , packageName ) ;
2426
2527/**
2628 * @type {import('next').NextConfig }
2729 */
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 } ,
3335 // reactStrictMode: true, // TODO: Blocked by @rjsf Form using UNSAFE_componentWillReceiveProps
3436 pageExtensions : [ "js" , "ts" , "jsx" , "tsx" , "mdx" ] ,
3537 // replace empty string with undefined
3638 // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
3739 basePath : process . env . NEXT_PUBLIC_BASE_PATH || undefined ,
3840 transpilePackages : MONOREPO_MODE ? [ "@squonk/mui-theme" , "@squonk/sdf-parser" ] : [ ] ,
3941 sassOptions : {
42+ silenceDeprecations : [ "legacy-js-api" ] ,
4043 prependData : `$assetsURL: "${ process . env . ASSET_URL ?? "https://squonk.informaticsmatters.org" } ";` ,
4144 } ,
4245 images : {
@@ -65,27 +68,14 @@ const withBundleAnalyser = bundleAnalyze({
6568nextConfig = withBundleAnalyser ( nextConfig ) ;
6669nextConfig = withMDX ( nextConfig ) ;
6770nextConfig = 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
7374
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+ } ) ;
9080
9181export default nextConfig ;
0 commit comments