Skip to content

Commit d4e9742

Browse files
committed
add flag for disabling debugid upload
1 parent bf394f1 commit d4e9742

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

packages/bundler-plugin-core/src/index.ts

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -126,22 +126,24 @@ export function sentryUnpluginFactory({
126126
if (!options.sourcemaps?.disable) {
127127
plugins.push(debugIdInjectionPlugin(logger));
128128

129-
// This option is only strongly typed for the webpack plugin, where it is used. It has no effect on other plugins
130-
const webpack_forceExitOnBuildComplete =
131-
typeof options._experiments["forceExitOnBuildCompletion"] === "boolean"
132-
? options._experiments["forceExitOnBuildCompletion"]
133-
: undefined;
134-
135-
plugins.push(
136-
debugIdUploadPlugin(
137-
createDebugIdUploadFunction({
138-
sentryBuildPluginManager,
139-
}),
140-
logger,
141-
sentryBuildPluginManager.createDependencyOnBuildArtifacts,
142-
webpack_forceExitOnBuildComplete
143-
)
144-
);
129+
if (options.sourcemaps?.disable !== "disable-upload") {
130+
// This option is only strongly typed for the webpack plugin, where it is used. It has no effect on other plugins
131+
const webpack_forceExitOnBuildComplete =
132+
typeof options._experiments["forceExitOnBuildCompletion"] === "boolean"
133+
? options._experiments["forceExitOnBuildCompletion"]
134+
: undefined;
135+
136+
plugins.push(
137+
debugIdUploadPlugin(
138+
createDebugIdUploadFunction({
139+
sentryBuildPluginManager,
140+
}),
141+
logger,
142+
sentryBuildPluginManager.createDependencyOnBuildArtifacts,
143+
webpack_forceExitOnBuildComplete
144+
)
145+
);
146+
}
145147
}
146148

147149
if (options.reactComponentAnnotation) {

packages/bundler-plugin-core/src/options-mapping.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export type NormalizedOptions = {
2323
disable: boolean;
2424
sourcemaps:
2525
| {
26-
disable?: boolean;
26+
disable?: boolean | "disable-upload";
2727
assets?: string | string[];
2828
ignore?: string | string[];
2929
rewriteSources?: RewriteSourcesHook;

packages/bundler-plugin-core/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export interface Options {
9595
*
9696
* Defaults to `false`.
9797
*/
98-
disable?: boolean;
98+
disable?: boolean | "disable-upload";
9999

100100
/**
101101
* A glob or an array of globs that specifies the build artifacts that should be uploaded to Sentry.

0 commit comments

Comments
 (0)