11require ( "@akashnetwork/env-loader" ) ;
2- const { version } = require ( "./package.json" ) ;
2+ const { version, repository } = require ( "./package.json" ) ;
3+ const { withSentryConfig } = require ( "@sentry/nextjs" ) ;
34
45try {
56 const { browserEnvSchema } = require ( "./env-config.schema" ) ;
@@ -14,13 +15,67 @@ try {
1415/** @type {import('next').NextConfig } */
1516const nextConfig = {
1617 output : "standalone" ,
17- publicRuntimeConfig : {
18- version
18+ env : {
19+ NEXT_PUBLIC_APP_VERSION : version
1920 } ,
2021 eslint : {
2122 ignoreDuringBuilds : true
2223 } ,
23- transpilePackages : [ "geist" , "@akashnetwork/ui" ]
24+ transpilePackages : [ "geist" , "@akashnetwork/ui" ] ,
25+ experimental : {
26+ instrumentationHook : true
27+ } ,
28+ /**
29+ *
30+ * @param {import('webpack').Configuration } config
31+ * @returns
32+ */
33+ webpack : config => {
34+ config . externals . push ( "pino-pretty" ) ;
35+
36+ return config ;
37+ }
38+ } ;
39+
40+ /**
41+ * For all available options, see:
42+ * https://github.com/getsentry/sentry-webpack-plugin#options.
43+ * @type {import('@sentry/nextjs').SentryBuildOptions }
44+ */
45+ const sentryWebpackPluginOptions = {
46+ // Additional config options for the Sentry Webpack plugin. Keep in mind that
47+ // the following options are set automatically, and overriding them is not
48+ // recommended:
49+ // release, url, org, project, authToken, configFile, stripPrefix,
50+ // urlPrefix, include, ignore
51+
52+ // silent: !process.env.CI, // Suppresses all logs,
53+ // dryRun: true,
54+ authToken : process . env . SENTRY_AUTH_TOKEN ,
55+ org : process . env . SENTRY_ORG ,
56+ project : process . env . SENTRY_PROJECT ,
57+ release : repository
58+ ? {
59+ name : version ,
60+ setCommits : {
61+ repo : new URL ( repository . url ) . pathname . slice ( 1 ) . replace ( / \. g i t $ / , "" ) ,
62+ commit : process . env . GIT_COMMIT_HASH
63+ }
64+ }
65+ : { name : version } ,
66+ sourcemaps : {
67+ deleteSourcemapsAfterUpload : false
68+ } ,
69+ widenClientFileUpload : true ,
70+ debug : ! process . env . CI ,
71+ reactComponentAnnotation : {
72+ enabled : true
73+ } ,
74+ unstable_sentryWebpackPluginOptions : {
75+ applicationKey : process . env . NEXT_PUBLIC_SENTRY_APPLICATION_KEY
76+ }
2477} ;
2578
26- module . exports = nextConfig ;
79+ // Make sure adding Sentry options is the last code to run before exporting, to
80+ // ensure that your source maps include changes from all other Webpack plugins
81+ module . exports = sentryWebpackPluginOptions . authToken ? withSentryConfig ( nextConfig , sentryWebpackPluginOptions ) : nextConfig ;
0 commit comments