Skip to content

Commit 2877fa0

Browse files
committed
Merge remote-tracking branch 'upstream/main' into timfish/feat/rolldown-build
2 parents 36f300c + 144e922 commit 2877fa0

24 files changed

Lines changed: 668 additions & 981 deletions

File tree

packages/bundler-plugin-core/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@
6060
"dotenv": "^16.3.1",
6161
"find-up": "^5.0.0",
6262
"glob": "^10.5.0",
63-
"magic-string": "0.30.8",
64-
"unplugin": "1.0.1"
63+
"magic-string": "0.30.8"
6564
},
6665
"devDependencies": {
6766
"@sentry-internal/eslint-config": "4.9.1",

packages/bundler-plugin-core/src/build-plugin-manager.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ import { glob } from "glob";
3030
import { defaultRewriteSourcesHook, prepareBundleForDebugIdUpload } from "./debug-id-upload";
3131
import { LIB_VERSION } from "./version";
3232

33+
// Module-level guard to prevent duplicate deploy records when multiple bundler plugin
34+
// instances run in the same process (e.g. Next.js creates separate webpack compilers
35+
// for client, server, and edge). Keyed by release name.
36+
const _deployedReleases = new Set<string>();
37+
38+
/** @internal Exported for testing only. */
39+
export function _resetDeployedReleasesForTesting(): void {
40+
_deployedReleases.clear();
41+
}
42+
3343
export type SentryBuildPluginManager = {
3444
/**
3545
* A logger instance that takes the options passed to the build plugin manager into account. (for silencing and log level etc.)
@@ -533,8 +543,9 @@ export function createSentryBuildPluginManager(
533543
await cliInstance.releases.finalize(options.release.name);
534544
}
535545

536-
if (options.release.deploy) {
546+
if (options.release.deploy && !_deployedReleases.has(options.release.name)) {
537547
await cliInstance.releases.newDeploy(options.release.name, options.release.deploy);
548+
_deployedReleases.add(options.release.name);
538549
}
539550
} catch (e) {
540551
sentryScope.captureException('Error in "releaseManagementPlugin" writeBundle hook');

0 commit comments

Comments
 (0)