Skip to content

ref(bundler-plugins)!: Require webpack 5.1 and remove the webpack5 entry point - #24455

Open
timfish wants to merge 4 commits into
developfrom
claude/gifted-johnson-6ymldh
Open

timfish wants to merge 4 commits into
developfrom
claude/gifted-johnson-6ymldh

Conversation

@timfish

@timfish timfish commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

The webpack plugin still carried its webpack 4 era structure: a sentryWebpackPluginFactory that took BannerPlugin/DefinePlugin classes so the same code could serve webpack 4 and 5, a require('webpack') at module load to feed those fallbacks, and a separate webpack5 entry point whose only difference was calling that factory without them. Webpack 4 hasn't been supported for a long time.

The plugin now reads the classes from compiler.webpack only, so the factory and the fallback are gone. compiler.webpack was added in webpack 5.1.0, three days after 5.0.0, so the webpack peer dependency moves to >=5.1.0. With the fallback gone there is nothing left to distinguish @sentry/bundler-plugins/webpack5 from @sentry/bundler-plugins/webpack, so the webpack5 entry point is removed rather than deprecated. Both changes are documented in the v11 migration guide.

Tim Fish and others added 4 commits September 17, 2026 10:41
…try point

The webpack plugin no longer goes through a factory that takes
BannerPlugin/DefinePlugin classes; it reads them from compiler.webpack
and only falls back to the installed webpack module for 5.0.x. The
@sentry/bundler-plugins/webpack5 entry point is now a deprecated alias
of @sentry/bundler-plugins/webpack.
…try point

The webpack plugin no longer goes through a factory that takes
BannerPlugin/DefinePlugin classes as a fallback for webpack < 5.1; it
reads them from compiler.webpack only, so the webpack peer dependency
is now >=5.1.0. The @sentry/bundler-plugins/webpack5 entry point, which
exported the same plugin without that fallback, is removed.
# Conflicts:
#	CHANGELOG.md
#	packages/bundler-plugins/src/webpack/index.ts
#	packages/bundler-plugins/src/webpack/webpack5.ts
#	packages/bundler-plugins/test/webpack/public-api.test.ts
#	packages/bundler-plugins/test/webpack/webpack5.test.ts
@timfish
timfish marked this pull request as ready for review September 17, 2026 11:16
@timfish
timfish requested a review from chargome September 17, 2026 11:16
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 29.09 kB - -
@sentry/browser - with treeshaking flags 27.35 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.26 kB - -
@sentry/browser (incl. Tracing) 50.6 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 50.62 kB - -
@sentry/browser (incl. Tracing, Profiling) 53.61 kB - -
@sentry/browser (incl. Tracing, Replay) 90.15 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.25 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 94.85 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 107.83 kB - -
@sentry/browser (incl. Feedback) 46.62 kB - -
@sentry/browser (incl. sendFeedback) 34.15 kB - -
@sentry/browser (incl. FeedbackAsync) 39.26 kB - -
@sentry/browser (incl. Metrics) 30.1 kB - -
@sentry/browser (incl. Logs) 30.35 kB - -
@sentry/browser (incl. Metrics & Logs) 31.02 kB - -
@sentry/react 30.84 kB - -
@sentry/react (incl. Tracing) 52.94 kB - -
@sentry/vue 36.34 kB - -
@sentry/vue (incl. Tracing) 52.91 kB - -
@sentry/svelte 29.11 kB - -
CDN Bundle 30.8 kB - -
CDN Bundle (incl. Tracing) 51.15 kB - -
CDN Bundle (incl. Logs, Metrics) 33.06 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 53.14 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.75 kB - -
CDN Bundle (incl. Tracing, Replay) 88.69 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 90.63 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 94.73 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 96.78 kB - -
CDN Bundle - uncompressed 91.16 kB - -
CDN Bundle (incl. Tracing) - uncompressed 152.66 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.73 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 158.61 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 227.14 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 272.23 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 278.17 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 285.93 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 291.86 kB - -
@sentry/nextjs (client) 55.27 kB - -
@sentry/sveltekit (client) 51.05 kB - -
@sentry/core/server 39.63 kB - -
@sentry/core/browser 13.66 kB - -
@sentry/node 132.37 kB +0.02% +18 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.03 kB - -
@sentry/node - without tracing 89.82 kB +0.04% +30 B 🔺
@sentry/node - without channel injection 111.23 kB +0.02% +17 B 🔺
@sentry/aws-serverless 98.06 kB +0.03% +25 B 🔺
@sentry/cloudflare (withSentry) - minified 204.52 kB - -
@sentry/cloudflare (withSentry) 508.73 kB - -

View base workflow run

Comment thread CHANGELOG.md

Work in this release was contributed by @psh4607, @thijsw, @trinitiwowka, @nehaprasad-dev, @JealousGx, @Jxxunnn, @eddie333016, @davidmurdoch, @yashschandra, @atharv-sys32, @AG0708, @birkskyum, @mkly, @mcbbugu, @suhailopensource, @zkasuran, @mohd-akram, @RealBhupesh, @halillusion, @psang39, @hafzism, @JosephDoUrden, @Tyagiquamar, @Andarist, and @msnelling. Thank you for your contributions!

- ref(bundler-plugins)!: The webpack plugin now requires webpack 5.1 or newer and reads its plugin classes from `compiler.webpack` only, so the `webpack` peer dependency is now `>=5.1.0`. The `@sentry/bundler-plugins/webpack5` entry point was removed; import `sentryWebpackPlugin` from `@sentry/bundler-plugins/webpack` instead, which exports the same plugin.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- ref(bundler-plugins)!: The webpack plugin now requires webpack 5.1 or newer and reads its plugin classes from `compiler.webpack` only, so the `webpack` peer dependency is now `>=5.1.0`. The `@sentry/bundler-plugins/webpack5` entry point was removed; import `sentryWebpackPlugin` from `@sentry/bundler-plugins/webpack` instead, which exports the same plugin.

I think we can skip this entry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants