Skip to content

Commit bb2fc7c

Browse files
committed
feat(nuxt): add silent, errorHandler, release to SourceMapsOptions
1 parent 3e31bdc commit bb2fc7c

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

packages/nuxt/src/common/types.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,37 @@ export type SentryNuxtClientOptions = Omit<Parameters<typeof initVue>[0] & objec
88
export type SentryNuxtServerOptions = Omit<Parameters<typeof initNode>[0] & object, 'app'>;
99

1010
type SourceMapsOptions = {
11+
/**
12+
* Suppresses all logs.
13+
*
14+
* @default false
15+
*/
16+
silent?: SentryVitePluginOptions['silent'];
17+
18+
/**
19+
* When an error occurs during release creation or sourcemaps upload, the plugin will call this function.
20+
*
21+
* By default, the plugin will simply throw an error, thereby stopping the bundling process.
22+
* If an `errorHandler` callback is provided, compilation will continue, unless an error is
23+
* thrown in the provided callback.
24+
*
25+
* To allow compilation to continue but still emit a warning, set this option to the following:
26+
*
27+
* ```js
28+
* (err) => {
29+
* console.warn(err);
30+
* }
31+
* ```
32+
*/
33+
errorHandler?: SentryVitePluginOptions['errorHandler'];
34+
35+
/**
36+
* Options related to managing the Sentry releases for a build.
37+
*
38+
* More info: https://docs.sentry.io/product/releases/
39+
*/
40+
release?: SentryVitePluginOptions['release'];
41+
1142
/**
1243
* If this flag is `true`, and an auth token is detected, the Sentry SDK will
1344
* automatically generate and upload source maps to Sentry during a production build.

packages/nuxt/src/vite/sourceMaps.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ export function getPluginOptions(
9393
telemetry: sourceMapsUploadOptions.telemetry ?? true,
9494
url: sourceMapsUploadOptions.url ?? process.env.SENTRY_URL,
9595
debug: moduleOptions.debug ?? false,
96+
silent: sourceMapsUploadOptions.silent ?? false,
97+
errorHandler: sourceMapsUploadOptions.errorHandler,
98+
release: sourceMapsUploadOptions.release,
9699
_metaOptions: {
97100
telemetry: {
98101
metaFramework: 'nuxt',

0 commit comments

Comments
 (0)