|
4 | 4 | * Config based on https://github.com/elastic/next-eui-starter
|
5 | 5 | */
|
6 | 6 |
|
| 7 | +import { execSync } from 'child_process'; |
7 | 8 | import { withSentryConfig } from '@sentry/nextjs';
|
8 | 9 | import dotenv from 'dotenv';
|
9 | 10 | import webpack from 'webpack';
|
10 | 11 |
|
11 | 12 | dotenv.config();
|
12 | 13 |
|
| 14 | +const gitHash = execSync('git rev-parse --short HEAD').toString().trim(); |
| 15 | + |
13 | 16 | const pathPrefix = '';
|
14 | 17 |
|
15 | 18 | const { EnvironmentPlugin, IgnorePlugin } = webpack;
|
@@ -274,19 +277,28 @@ export default withSentryConfig(nextConfig, {
|
274 | 277 | // For all available options, see:
|
275 | 278 | // https://github.com/getsentry/sentry-webpack-plugin#options
|
276 | 279 |
|
277 |
| - // Suppresses source map uploading logs during build |
278 |
| - silent: true, |
279 | 280 | org: process.env.SENTRY_ORG,
|
280 | 281 | project: process.env.SENTRY_PROJECT,
|
281 | 282 | authToken: process.env.SENTRY_AUTH_TOKEN,
|
282 | 283 |
|
| 284 | + release: { |
| 285 | + |
| 286 | + name: `${process.env.npm_package_name}@${process.env.npm_package_version}-${gitHash}`, |
| 287 | + }, |
| 288 | + |
| 289 | + // Suppresses source map uploading logs during build. |
| 290 | + silent: !process.env.CI, |
| 291 | + |
| 292 | + // Don't send internal plugin errors and performance data to Sentry. |
| 293 | + telemetry: false, |
| 294 | + |
283 | 295 | // For all available options, see:
|
284 | 296 | // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
|
285 | 297 |
|
286 |
| - // Upload a larger set of source maps for prettier stack traces (increases build time) |
| 298 | + // Upload a larger set of source maps for prettier stack traces (increases build time). |
287 | 299 | widenClientFileUpload: true,
|
288 | 300 |
|
289 |
| - // Automatically tree-shake Sentry logger statements to reduce bundle size |
| 301 | + // Automatically tree-shake Sentry logger statements to reduce bundle size. |
290 | 302 | disableLogger: true,
|
291 | 303 |
|
292 | 304 | sourcemaps: {
|
|
0 commit comments