Skip to content

Commit f6a63bc

Browse files
authored
feat(v8/nuxt): Add enabled to disable Sentry module (#15337) (#15381)
Backport of #15337
1 parent b10978f commit f6a63bc

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

packages/nuxt/src/common/types.ts

+7
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ type SourceMapsOptions = {
9595
* Build options for the Sentry module. These options are used during build-time by the Sentry SDK.
9696
*/
9797
export type SentryNuxtModuleOptions = {
98+
/**
99+
* Enable the Sentry Nuxt Module.
100+
*
101+
* @default true
102+
*/
103+
enabled?: boolean;
104+
98105
/**
99106
* Options for the Sentry Vite plugin to customize the source maps upload process.
100107
*

packages/nuxt/src/module.ts

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ export default defineNuxtModule<ModuleOptions>({
1818
},
1919
defaults: {},
2020
setup(moduleOptionsParam, nuxt) {
21+
if ('enabled' in moduleOptionsParam && moduleOptionsParam.enabled === false) {
22+
return;
23+
}
24+
2125
const moduleOptions = {
2226
...moduleOptionsParam,
2327
autoInjectServerSentry: moduleOptionsParam.autoInjectServerSentry,

0 commit comments

Comments
 (0)