Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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: 17 additions & 17 deletions packages/bundler-plugin-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,24 +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
)
);
// 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) {
if (!options.reactComponentAnnotation.enabled) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { sentryRollupPlugin } from "@sentry/rollup-plugin";

const debugIdUploadPluginName = "sentry-rollup-debug-id-upload-plugin";

test("should not call upload plugin when sourcemaps are disabled", () => {
const plugins = sentryRollupPlugin({
telemetry: false,
sourcemaps: {
disable: true,
},
}) as Array<{ name: string }>;

const debugIdUploadPlugin = plugins.find((plugin) => plugin.name === debugIdUploadPluginName);

expect(debugIdUploadPlugin).toBeUndefined();
});

test("should call upload plugin when sourcemaps are enabled", () => {
const plugins = sentryRollupPlugin({
telemetry: false,
}) as Array<{ name: string }>;

const debugIdUploadPlugin = plugins.find((plugin) => plugin.name === debugIdUploadPluginName);

expect(debugIdUploadPlugin).toBeDefined();
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// eslint-disable-next-line no-console
console.log("Beep!");
Loading