Skip to content

feat(webpack): Add sentry/webpack-plugin/webpack5 export for webpack 5.1+ and compatible environments #715

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 2, 2025

Conversation

krystofwoldrich
Copy link
Contributor

@krystofwoldrich krystofwoldrich commented Apr 2, 2025

This PR adds @sentry/webpack-plugin/webpack5 export, which doesn't depend on the webpack module as recommended in the official webpack guide https://webpack.js.org/contribute/writing-a-plugin/#example.

This makes the plugin compatible with webpack like environments, for example, rspack, without the need to add webpack to the project.

import { sentryWebpackPlugin } from '@sentry/webpack-plugin/webpack5'

sentryWebpackPlugin({
}),

The public interface is the same. In the future major version, this can be the default export, but at the moment, it would be a breaking change.

@krystofwoldrich krystofwoldrich requested review from lforst and Lms24 April 2, 2025 09:04
Copy link

@lforst lforst left a comment

Choose a reason for hiding this comment

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

Nice solution!

@krystofwoldrich krystofwoldrich merged commit f577a47 into main Apr 2, 2025
18 checks passed
@krystofwoldrich krystofwoldrich deleted the kw-webpack-5-1-plus branch April 2, 2025 16:04
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Apr 5, 2025
| datasource | package             | from  | to    |
| ---------- | ------------------- | ----- | ----- |
| npm        | @sentry/vite-plugin | 3.2.4 | 3.3.1 |


## [v3.3.1](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/HEAD/CHANGELOG.md#331)

-   fix(webpack5): All `esm` files must have `.mjs` postfix ([#721](getsentry/sentry-javascript-bundler-plugins#721))


## [v3.3.0](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/HEAD/CHANGELOG.md#330)

-   feat(webpack): Add `@sentry/webpack-plugin/webpack5` export for webpack 5.1+ and compatible environments ([#715](getsentry/sentry-javascript-bundler-plugins#715))
-   feat: Only do automatic commit association for Vercel production environments ([#711](getsentry/sentry-javascript-bundler-plugins#711))
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Apr 5, 2025
| datasource | package             | from  | to    |
| ---------- | ------------------- | ----- | ----- |
| npm        | @sentry/vite-plugin | 3.2.4 | 3.3.1 |


## [v3.3.1](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/HEAD/CHANGELOG.md#331)

-   fix(webpack5): All `esm` files must have `.mjs` postfix ([#721](getsentry/sentry-javascript-bundler-plugins#721))


## [v3.3.0](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/HEAD/CHANGELOG.md#330)

-   feat(webpack): Add `@sentry/webpack-plugin/webpack5` export for webpack 5.1+ and compatible environments ([#715](getsentry/sentry-javascript-bundler-plugins#715))
-   feat: Only do automatic commit association for Vercel production environments ([#711](getsentry/sentry-javascript-bundler-plugins#711))
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