1+ import { withSentryConfig } from "@sentry/nextjs" ;
2+ import type { NextConfig } from "next" ;
13import createNextIntlPlugin from "next-intl/plugin" ;
24import { DEFAULT_CSP } from "./constants/csp.js" ;
35
@@ -49,41 +51,36 @@ const secureHeaders = (() => {
4951
5052const imageRemotePatterns = [
5153 {
52- protocol : "http" ,
54+ protocol : "http" as const ,
5355 hostname : "localhost" ,
5456 port : "8080" ,
5557 pathname : "/**" ,
5658 } ,
5759 {
58- protocol : "https" ,
60+ protocol : "https" as const ,
5961 hostname : "*.zitadel.*" ,
6062 port : "" ,
6163 pathname : "/**" ,
6264 } ,
63- ] ;
65+ ] satisfies NonNullable < NextConfig [ "images" ] > [ "remotePatterns" ] ;
6466
6567if ( process . env . ZITADEL_API_URL ) {
6668 imageRemotePatterns . push ( {
67- protocol : "https" ,
69+ protocol : "https" as const ,
6870 hostname : process . env . ZITADEL_API_URL ?. replace ( "https://" , "" ) || "" ,
6971 port : "" ,
7072 pathname : "/**" ,
7173 } ) ;
7274}
7375
74- const nextConfig = {
76+ const nextConfig : NextConfig = {
7577 basePath : process . env . NEXT_PUBLIC_BASE_PATH ,
76- output : process . env . NEXT_OUTPUT_MODE | | undefined ,
78+ output : process . env . NEXT_OUTPUT_MODE as "standalone" | "export" | undefined ,
7779 reactStrictMode : true , // Recommended for the `pages` directory, default in `app`.
78- experimental : {
79- dynamicIO : true ,
80- } ,
80+ cacheComponents : true ,
8181 images : {
8282 remotePatterns : imageRemotePatterns ,
8383 } ,
84- eslint : {
85- ignoreDuringBuilds : true ,
86- } ,
8784 async headers ( ) {
8885 return [
8986 {
@@ -94,4 +91,29 @@ const nextConfig = {
9491 } ,
9592} ;
9693
97- export default withNextIntl ( nextConfig ) ;
94+ export default withSentryConfig ( withNextIntl ( nextConfig ) , {
95+ // For all available options, see:
96+ // https://www.npmjs.com/package/@sentry /webpack-plugin#options
97+
98+ org : "sentry" ,
99+
100+ project : "auth-ui" ,
101+ sentryUrl : process . env . NEXT_PUBLIC_SENTRY_URL ,
102+
103+ // Only print logs for uploading source maps in CI
104+ silent : ! process . env . CI ,
105+
106+ // For all available options, see:
107+ // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
108+
109+ // Upload a larger set of source maps for prettier stack traces (increases build time)
110+ widenClientFileUpload : true ,
111+
112+ // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
113+ // This can increase your server load as well as your hosting bill.
114+ // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
115+ // side errors will fail.
116+ tunnelRoute : "/monitoring" ,
117+
118+
119+ } ) ;
0 commit comments