{"id":13679480,"url":"https://github.com/getsentry/sentry-webpack-plugin","last_synced_at":"2025-04-29T19:31:18.725Z","repository":{"id":37602889,"uuid":"105764023","full_name":"getsentry/sentry-webpack-plugin","owner":"getsentry","description":"Repo moved to https://github.com/getsentry/sentry-javascript-bundler-plugins. Please open any issues/PRs there.","archived":true,"fork":false,"pushed_at":"2023-11-16T09:48:25.000Z","size":1182,"stargazers_count":663,"open_issues_count":15,"forks_count":116,"subscribers_count":60,"default_branch":"master","last_synced_at":"2025-04-20T09:43:11.879Z","etag":null,"topics":["tag-archived"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/getsentry.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"custom":["https://sentry.io/pricing/","https://sentry.io/"]}},"created_at":"2017-10-04T12:11:08.000Z","updated_at":"2025-03-13T13:39:15.000Z","dependencies_parsed_at":"2024-01-14T14:33:58.077Z","dependency_job_id":"f08f78ac-e92f-4b65-b96c-88164df22e28","html_url":"https://github.com/getsentry/sentry-webpack-plugin","commit_stats":{"total_commits":276,"total_committers":62,"mean_commits":4.451612903225806,"dds":0.6014492753623188,"last_synced_commit":"2b7d274a7355f0d27a431b2c20c37c9786bbe4cb"},"previous_names":[],"tags_count":54,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getsentry%2Fsentry-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getsentry%2Fsentry-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getsentry%2Fsentry-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getsentry%2Fsentry-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getsentry","download_url":"https://codeload.github.com/getsentry/sentry-webpack-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251569548,"owners_count":21610575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["tag-archived"],"created_at":"2024-08-02T13:01:05.963Z","updated_at":"2025-04-29T19:31:18.368Z","avatar_url":"https://github.com/getsentry.png","language":"JavaScript","readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://sentry.io/?utm_source=github\u0026utm_medium=logo\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png\" alt=\"Sentry\" width=\"280\" height=\"84\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# Moved!\n\n\u003e ⚠️ Notice: The repository for the `@sentry/webpack-plugin` package moved to\n\u003e https://github.com/getsentry/sentry-javascript-bundler-plugins.\n\u003e\n\u003e Please open any issues and PRs over there, as this repository is no longer\n\u003e maintained!\n\n# Sentry Webpack Plugin\n\nA webpack plugin acting as an interface to\n[Sentry CLI](https://docs.sentry.io/learn/cli/).\n\n### Installation\n\n`@sentry/webpack-plugin` requires at least `webpack@4.41.31` or any `webpack@5`\nversion to be installed.\n\nUsing npm:\n\n```bash\n$ npm install @sentry/webpack-plugin --save-dev\n```\n\nUsing yarn:\n\n```bash\n$ yarn add @sentry/webpack-plugin --dev\n```\n\n### CLI Configuration\n\nYou can use either `.sentryclirc` file or ENV variables described here\nhttps://docs.sentry.io/cli/configuration.\n\n### Usage\n\n```js\nconst SentryWebpackPlugin = require('@sentry/webpack-plugin');\n\nconst config = {\n  plugins: [\n    new SentryWebpackPlugin({\n      include: '.',\n      ignoreFile: '.sentrycliignore',\n      ignore: ['node_modules', 'webpack.config.js'],\n      configFile: 'sentry.properties',\n    }),\n  ],\n};\n```\n\nAlso, check the [example](example) directory.\n\n#### Options\n\n| Option             | Type                                                                                | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                    |\n| ------------------ | ----------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| include            | `string`/`array`/`object`                                                           | required | One or more paths that Sentry CLI should scan recursively for sources. It will upload all `.map` files and match associated `.js` files. Each path can be given as an object with path-specific options. See [table below](#include) for details.                                                                                                                                                                              |\n| org                | `string`                                                                            | optional | The slug of the Sentry organization associated with the app. Can also be specified via `process.env.SENTRY_ORG`.                                                                                                                                                                                                                                                                                                               |\n| project            | `string`                                                                            | optional | The slug of the Sentry project associated with the app. Can also be specified via `process.env.SENTRY_PROJECT`.                                                                                                                                                                                                                                                                                                                |\n| authToken          | `string`                                                                            | optional | The authentication token to use for all communication with Sentry. Can be obtained from https://sentry.io/settings/account/api/auth-tokens/. Required scopes: `project:releases` (and `org:read` if `setCommits` option is used).                                                                                                                                                                                              |\n| url                | `string`                                                                            | optional | The base URL of your Sentry instance. Defaults to https://sentry.io/, which is the correct value for SAAS customers.                                                                                                                                                                                                                                                                                                           |\n| customHeader       | `string`                                                                            | optional | A header added to all outgoing requests. A string in the format `header-key: header-value`                                                                                                                                                                                                                                                                                                                                     |\n| vcsRemote          | `string`                                                                            | optional | The name of the remote in the version control system. Defaults to `origin`.                                                                                                                                                                                                                                                                                                                                                    |\n| release            | `string`                                                                            | optional | Unique identifier for the release. Can also be specified via `process.env.SENTRY_RELEASE`. Defaults to the output of the `sentry-cli releases propose-version` command, which automatically detects values for Cordova, Heroku, AWS CodeBuild, CircleCI, Xcode, and Gradle, and otherwise uses `HEAD`'s commit SHA. (**For `HEAD` option, requires access to `git` CLI and for the root directory to be a valid repository**). |\n| dist               | `string`                                                                            | optional | Unique identifier for the distribution, used to further segment your release. Usually your build number.                                                                                                                                                                                                                                                                                                                       |\n| entries            | `array`/`RegExp`/`function(key: string): bool`                                      | optional | Filter for entry points that should be processed. By default, the release will be injected into all entry points.                                                                                                                                                                                                                                                                                                              |\n| ignoreFile         | `string`                                                                            | optional | Path to a file containing list of files/directories to ignore. Can point to `.gitignore` or anything with the same format.                                                                                                                                                                                                                                                                                                     |\n| ignore             | `string`/`array`                                                                    | optional | One or more paths to ignore during upload. Overrides entries in `ignoreFile` file. If neither `ignoreFile` nor `ignore` is present, defaults to `['node_modules']`.                                                                                                                                                                                                                                                            |\n| configFile         | `string`                                                                            | optional | Path to Sentry CLI config properties, as described in https://docs.sentry.io/product/cli/configuration/#configuration-file. By default, the config file is looked for upwards from the current path, and defaults from `~/.sentryclirc` are always loaded                                                                                                                                                                      |\n| ext                | `array`                                                                             | optional | The file extensions to be considered. By default the following file extensions are processed: `js`, `map`, `jsbundle`, and `bundle`.                                                                                                                                                                                                                                                                                           |\n| urlPrefix          | `string`                                                                            | optional | URL prefix to add to the beginning of all filenames. Defaults to `~/` but you might want to set this to the full URL. This is also useful if your files are stored in a sub folder. eg: `url-prefix '~/static/js'`.                                                                                                                                                                                                            |\n| urlSuffix          | `string`                                                                            | optional | URL suffix to add to the end of all filenames. Useful for appending query parameters.                                                                                                                                                                                                                                                                                                                                          |\n| validate           | `boolean`                                                                           | optional | When `true`, attempts source map validation before upload if rewriting is not enabled. It will spot a variety of issues with source maps and cancel the upload if any are found. Defaults to `false` to prevent false positives canceling upload.                                                                                                                                                                              |\n| stripPrefix        | `array`                                                                             | optional | When paired with `rewrite`, will remove a prefix from filename references inside of sourcemaps. Useful for removing a path that is build-machine-specific. Note that this will NOT change the names of uploaded files.                                                                                                                                                                                                         |\n| stripCommonPrefix  | `boolean`                                                                           | optional | When paired with `rewrite`, will add `~` to the `stripPrefix` array. Defaults to `false`.                                                                                                                                                                                                                                                                                                                                      |\n| sourceMapReference | `boolean`                                                                           | optional | Determines whether sentry-cli should attempt to link minified files with their corresponding maps. By default, it will match files and maps based on name, and add a `Sourcemap` header to each minified file for which it finds a map. Can be disabled if all minified files contain `sourceMappingURL`. Defaults to `true`.                                                                                                  |\n| rewrite            | `boolean`                                                                           | optional | Enables rewriting of matching source maps so that indexed maps are flattened and missing sources are inlined if possible. Defaults to `true`                                                                                                                                                                                                                                                                                   |\n| finalize           | `boolean`                                                                           | optional | Determines whether Sentry release record should be automatically finalized (`date_released` timestamp added) after artifact upload. Defaults to `true`                                                                                                                                                                                                                                                                         |\n| dryRun             | `boolean`                                                                           | optional | Attempts a dry run (useful for dev environments). Defaults to `false`, but may be automatically set to true in development environments by some framework integrations (Next.JS, possibly others).                                                                                                                                                                                                                             |\n| debug              | `boolean`                                                                           | optional | Print useful debug information. Defaults to `false`.                                                                                                                                                                                                                                                                                                                                                                           |\n| silent             | `boolean`                                                                           | optional | Suppresses all logs (useful for `--json` option). Defaults to `false`.                                                                                                                                                                                                                                                                                                                                                         |\n| cleanArtifacts     | `boolean`                                                                           | optional | Remove all the artifacts in the release before the upload. Defaults to `false`.                                                                                                                                                                                                                                                                                                                                                |\n| errorHandler       | `function(err: Error, invokeErr: function(): void, compilation: Compilation): void` | optional | Function to call a when CLI error occurs. Webpack compilation failure can be triggered by calling `invokeErr` callback. Can emit a warning rather than an error (allowing compilation to continue) by setting this to `(err, invokeErr, compilation) =\u003e { compilation.warnings.push('Sentry CLI Plugin: ' + err.message) }`. Defaults to `(err, invokeErr) =\u003e { invokeErr() }`.                                                |\n| setCommits         | `Object`                                                                            | optional | Adds commits to Sentry. See [table below](#optionssetcommits) for details.                                                                                                                                                                                                                                                                                                                                                     |\n| deploy             | `Object`                                                                            | optional | Creates a new release deployment in Sentry. See [table below](#deploy) for details.                                                                                                                                                                                                                                                                                                                                            |\n\n#### \u003ca name=\"include\"\u003e\u003c/a\u003eoptions.include:\n\n| Option             | Type             | Required | Description                                    |\n| ------------------ | ---------------- | -------- | ---------------------------------------------- |\n| paths              | `array`          | required | One or more paths to scan for files to upload. |\n| ignoreFile         | `string`         | optional | See above.                                     |\n| ignore             | `string`/`array` | optional | See above.                                     |\n| ext                | `array`          | optional | See above.                                     |\n| urlPrefix          | `string`         | optional | See above.                                     |\n| urlSuffix          | `string`         | optional | See above.                                     |\n| stripPrefix        | `array`          | optional | See above.                                     |\n| stripCommonPrefix  | `boolean`        | optional | See above.                                     |\n| sourceMapReference | `boolean`        | optional | See above.                                     |\n| rewrite            | `boolean`        | optional | See above.                                     |\n\nExample:\n\n```js\nconst SentryWebpackPlugin = require('@sentry/webpack-plugin');\n\nconst config = {\n  plugins: [\n    new SentryWebpackPlugin({\n      include: [\n        {\n          paths: ['./packages'],\n          urlPrefix: '~/path/to/packages',\n        },\n        {\n          paths: ['./client'],\n          urlPrefix: '~/path/to/client',\n        },\n      ],\n      ignoreFile: '.sentrycliignore',\n      ignore: ['node_modules', 'webpack.config.js'],\n      configFile: 'sentry.properties',\n    }),\n  ],\n};\n```\n\n#### \u003ca name=\"setCommits\"\u003e\u003c/a\u003eoptions.setCommits:\n\n| Option         | Type      | Required  | Description                                                                                                                                                                                                              |\n| -------------- | --------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| repo           | `string`  | see notes | The full git repo name as defined in Sentry. Required if `auto` option is not `true`, otherwise optional.                                                                                                                |\n| commit         | `string`  | see notes | The current (most recent) commit in the release. Required if `auto` option is not `true`, otherwise optional.                                                                                                            |\n| previousCommit | `string`  | optional  | The last commit of the previous release. Defaults to the most recent commit of the previous release in Sentry, or if no previous release is found, 10 commits back from `commit`.                                        |\n| auto           | `boolean` | optional  | Automatically set `commit` and `previousCommit`. Defaults `commit` to `HEAD` and `previousCommit` as described above. Overrides other options                                                                            |\n| ignoreMissing  | `boolean` | optional  | When the flag is set and the previous release commit was not found in the repository, will create a release with the default commits count (or the one specified with `--initial-depth`) instead of failing the command. |\n\n#### \u003ca name=\"deploy\"\u003e\u003c/a\u003eoptions.deploy:\n\n| Option   | Type     | Required | Description                                                                      |\n| -------- | -------- | -------- | -------------------------------------------------------------------------------- |\n| env      | `string` | required | Environment value for the release, for example `production` or `staging`.        |\n| started  | `number` | optional | UNIX timestamp for deployment start.                                             |\n| finished | `number` | optional | UNIX timestamp for deployment finish.                                            |\n| time     | `number` | optional | Deployment duration in seconds. Can be used instead of `started` and `finished`. |\n| name     | `string` | optional | Human-readable name for this deployment.                                         |\n| url      | `string` | optional | URL that points to the deployment.                                               |\n\nYou can find more information about these options in our official docs:\nhttps://docs.sentry.io/product/cli/releases/#sentry-cli-sourcemaps.\n","funding_links":["https://sentry.io/pricing/","https://sentry.io/"],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetsentry%2Fsentry-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetsentry%2Fsentry-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetsentry%2Fsentry-webpack-plugin/lists"}