@@ -2,24 +2,60 @@ const { withPlausibleProxy } = require('next-plausible');
2
2
const getBaseApiUrl = require ( './shared' ) ;
3
3
const dotenv = require ( 'dotenv' ) ;
4
4
const path = require ( 'node:path' ) ;
5
+ const { withSentryConfig } = require ( '@sentry/nextjs' ) ;
5
6
6
7
dotenv . config ( { path : path . join ( __dirname , '..' , '..' , '.env' ) } ) ;
7
8
8
9
/** @type {import('next').NextConfig } */
9
- const nextConfig = withPlausibleProxy ( ) ( {
10
- productionBrowserSourceMaps : true ,
11
- env : {
12
- // biome-ignore lint/style/useNamingConvention: This is an environment variable
13
- NEXT_PUBLIC_API_URL : getBaseApiUrl ( ) ,
14
- } ,
15
- // Needed for a Next.js bug https://github.com/vercel/next.js/discussions/32237#discussioncomment-4793595
16
- webpack : ( config ) => {
17
- config . resolve . extensionAlias = {
18
- '.js' : [ '.ts' , '.tsx' , '.js' ] ,
19
- } ;
20
10
21
- return config ;
22
- } ,
23
- } ) ;
11
+ module . exports = withSentryConfig (
12
+ withPlausibleProxy ( ) ( {
13
+ productionBrowserSourceMaps : true ,
14
+ env : {
15
+ // biome-ignore lint/style/useNamingConvention: This is an environment variable
16
+ NEXT_PUBLIC_API_URL : getBaseApiUrl ( ) ,
17
+ } ,
18
+ // Needed for a Next.js bug https://github.com/vercel/next.js/discussions/32237#discussioncomment-4793595
19
+ webpack : ( config ) => {
20
+ config . resolve . extensionAlias = {
21
+ '.js' : [ '.ts' , '.tsx' , '.js' ] ,
22
+ } ;
23
+
24
+ return config ;
25
+ } ,
26
+ } ) ,
27
+ {
28
+ // For all available options, see:
29
+ // https://github.com/getsentry/sentry-webpack-plugin#options
30
+
31
+ org : 'frcsh' ,
32
+ project : 'hours-web' ,
33
+
34
+ // Only print logs for uploading source maps in CI
35
+ silent : ! process . env . CI ,
36
+
37
+ // For all available options, see:
38
+ // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
24
39
25
- module . exports = nextConfig ;
40
+ // Upload a larger set of source maps for prettier stack traces (increases build time)
41
+ widenClientFileUpload : true ,
42
+
43
+ // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
44
+ // This can increase your server load as well as your hosting bill.
45
+ // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
46
+ // side errors will fail.
47
+ tunnelRoute : '/__s' ,
48
+
49
+ // Hides source maps from generated client bundles
50
+ hideSourceMaps : false ,
51
+
52
+ // Automatically tree-shake Sentry logger statements to reduce bundle size
53
+ disableLogger : true ,
54
+
55
+ // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
56
+ // See the following for more information:
57
+ // https://docs.sentry.io/product/crons/
58
+ // https://vercel.com/docs/cron-jobs
59
+ automaticVercelMonitors : true ,
60
+ } ,
61
+ ) ;
0 commit comments