Webpack plugin to upload source maps to Sentry for error tracking. Current stable version 2.0.3 supports webpack 4 & 5 and Node >= 6. Works by creating Sentry releases and uploading source maps automatically during the webpack build. Key differentiator: integrates directly with webpack's compilation lifecycle, supports release commits, filename transforms, and include/exclude filters. v2 rewrote the plugin API for webpack 4 hooks, breaking compatibility with webpack 1-3 (use v1 for those).
npm install webpack-sentry-pluginVerified import paths — ran on the pinned version, not inferred.
Configures webpack to output source maps and upload them to Sentry via the plugin.
If using webpack 1-3, stick with v1.x (latest 1.16.0). v2.0.0 removed webpack 1-3 support.
Use a Sentry auth token instead of an API key. Generate from Sentry UI with 'project:releases' scope.
Ensure baseSentryURL does not end with '/projects'.
Use process.env.GIT_SHA or a function returning (hash) => `release-${hash}`.Ensure transformed paths begin with '~/' if you want Sentry's host wildcard matching.
npm install webpack-sentry-plugin --save-dev and use require() as package is CommonJS only.
Change to const SentryPlugin = require('webpack-sentry-plugin');Check SENTRY_AUTH_TOKEN env var is set and token has project:releases scope.
Match plugin version to webpack version: v1 for webpack 1-3, v2 for webpack 4-5.