Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions packages/bundler-plugin-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,22 +126,24 @@ export function sentryUnpluginFactory({
if (!options.sourcemaps?.disable) {
plugins.push(debugIdInjectionPlugin(logger));

// This option is only strongly typed for the webpack plugin, where it is used. It has no effect on other plugins
const webpack_forceExitOnBuildComplete =
typeof options._experiments["forceExitOnBuildCompletion"] === "boolean"
? options._experiments["forceExitOnBuildCompletion"]
: undefined;

plugins.push(
debugIdUploadPlugin(
createDebugIdUploadFunction({
sentryBuildPluginManager,
}),
logger,
sentryBuildPluginManager.createDependencyOnBuildArtifacts,
webpack_forceExitOnBuildComplete
)
);
if (options.sourcemaps?.disable !== "disable-upload") {
// This option is only strongly typed for the webpack plugin, where it is used. It has no effect on other plugins
const webpack_forceExitOnBuildComplete =
typeof options._experiments["forceExitOnBuildCompletion"] === "boolean"
? options._experiments["forceExitOnBuildCompletion"]
: undefined;

plugins.push(
debugIdUploadPlugin(
createDebugIdUploadFunction({
sentryBuildPluginManager,
}),
logger,
sentryBuildPluginManager.createDependencyOnBuildArtifacts,
webpack_forceExitOnBuildComplete
)
);
}
}

if (options.reactComponentAnnotation) {
Expand Down
2 changes: 1 addition & 1 deletion packages/bundler-plugin-core/src/options-mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export type NormalizedOptions = {
disable: boolean;
sourcemaps:
| {
disable?: boolean;
disable?: boolean | "disable-upload";
assets?: string | string[];
ignore?: string | string[];
rewriteSources?: RewriteSourcesHook;
Expand Down
5 changes: 4 additions & 1 deletion packages/bundler-plugin-core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,12 @@ export interface Options {
/**
* Disables all functionality related to sourcemaps.
*
* If set to `"disable-upload"`, the plugin will not upload sourcemaps to Sentry, but will inject debug IDs into the build artifacts.
* This is useful if you want to manually upload sourcemaps to Sentry at a later point in time.
*
* Defaults to `false`.
*/
disable?: boolean;
disable?: boolean | "disable-upload";

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