Skip to content

Commit 36878d1

Browse files
authored
feat(nuxt): Add enabled to disable Sentry module (#15337)
closes #14935
1 parent 53194d7 commit 36878d1

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Diff for: packages/nuxt/src/common/types.ts

+7
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,13 @@ type SourceMapsOptions = {
139139
* Build options for the Sentry module. These options are used during build-time by the Sentry SDK.
140140
*/
141141
export type SentryNuxtModuleOptions = {
142+
/**
143+
* Enable the Sentry Nuxt Module.
144+
*
145+
* @default true
146+
*/
147+
enabled?: boolean;
148+
142149
/**
143150
* Options for the Sentry Vite plugin to customize the source maps upload process.
144151
*

Diff for: 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 (moduleOptionsParam?.enabled === false) {
22+
return;
23+
}
24+
2125
const moduleOptions = {
2226
...moduleOptionsParam,
2327
autoInjectServerSentry: moduleOptionsParam.autoInjectServerSentry,

0 commit comments

Comments
 (0)