feat(bundlers): Add orchestrion bundler plugins#22124
Conversation
| * ``` | ||
| */ | ||
| export function sentryOrchestrionPlugin(options: PluginOptions = {}): ReturnType<typeof codeTransformer> { | ||
| return codeTransformer(orchestrionTransformOptions(options)); |
There was a problem hiding this comment.
Webpack skips externals stripping
Medium Severity
The new webpack orchestrion plugin only forwards to the upstream transformer and never adjusts externals, unlike the Rollup, esbuild, and Vite wrappers. When instrumented packages stay external, webpack resolves them from node_modules at runtime and the transform never runs, so channel injection silently fails.
Reviewed by Cursor Bugbot for commit f9aaa97. Configure here.
There was a problem hiding this comment.
webpack always bundles so it isn't required...
| // and never gets the diagnostics_channel calls injected. Mutating | ||
| // `initialOptions` inside `setup` is respected by esbuild — the upstream | ||
| // plugin sets `initialOptions.metafile` the same way. | ||
| build.initialOptions.external = withoutInstrumentedExternals(build.initialOptions.external); |
There was a problem hiding this comment.
esbuild string external crashes setup
Medium Severity
The esbuild plugin always passes build.initialOptions.external into withoutInstrumentedExternals, but esbuild allows external to be a single string as well as a string array. A string has no .filter, so plugin setup can throw and abort the build.
Reviewed by Cursor Bugbot for commit 4108067. Configure here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
There are 5 total unresolved issues (including 3 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b15cb00. Configure here.


There was already a Vite bundler plugin for orchestrion that included our instrumentations but this PR adds the ability to include additional instrumentations and adds plugins for other bundlers.
I left the Bun plugin out of
@sentry/server-utilsbecause there is already one in the Bun package and I can't see it being used anywhere else 🤷♂️