{"id":14976550,"url":"https://github.com/valentinfunk/webpack2-sentry-plugin","last_synced_at":"2025-06-21T00:07:46.976Z","repository":{"id":76051482,"uuid":"85065731","full_name":"ValentinFunk/webpack2-sentry-plugin","owner":"ValentinFunk","description":"Webpack plugin to upload source maps to Sentry","archived":false,"fork":false,"pushed_at":"2017-10-18T14:50:30.000Z","size":98,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-21T00:03:37.155Z","etag":null,"topics":["sentry","sourcemaps","webpack-plugin","webpack2"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"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/ValentinFunk.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-15T11:43:40.000Z","updated_at":"2019-08-23T23:28:22.000Z","dependencies_parsed_at":"2023-05-11T07:00:47.292Z","dependency_job_id":null,"html_url":"https://github.com/ValentinFunk/webpack2-sentry-plugin","commit_stats":{"total_commits":103,"total_committers":8,"mean_commits":12.875,"dds":"0.33009708737864074","last_synced_commit":"8a82072f63408ce79fa3a116c4310637315a64c7"},"previous_names":["valentinfunk/webpack2-sentry-plugin","kamshak/webpack2-sentry-plugin"],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/ValentinFunk/webpack2-sentry-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ValentinFunk%2Fwebpack2-sentry-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ValentinFunk%2Fwebpack2-sentry-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ValentinFunk%2Fwebpack2-sentry-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ValentinFunk%2Fwebpack2-sentry-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ValentinFunk","download_url":"https://codeload.github.com/ValentinFunk/webpack2-sentry-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ValentinFunk%2Fwebpack2-sentry-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261039105,"owners_count":23100975,"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":["sentry","sourcemaps","webpack-plugin","webpack2"],"created_at":"2024-09-24T13:54:03.478Z","updated_at":"2025-06-21T00:07:41.966Z","avatar_url":"https://github.com/ValentinFunk.png","language":"JavaScript","readme":"# Sentry plugin\n\n[![npm version](https://badge.fury.io/js/webpack2-sentry-plugin.svg)](https://badge.fury.io/js/webpack2-sentry-plugin) [![Build Status](https://travis-ci.org/Kamshak/webpack2-sentry-plugin.svg?branch=master)](https://travis-ci.org/Kamshak/webpack2-sentry-plugin)\n\nA webpack plugin to upload source maps to [Sentry](https://sentry.io/). Forked to support hidden sourcemaps and more configurations.\n\n### Installation\n\n\nUsing npm:\n\n```\n$ npm install webpack2-sentry-plugin --save-dev\n```\n\nUsing yarn:\n\n```\n$ yarn add webpack2-sentry-plugin --dev\n```\n\n### Usage\n\n1. Configure Webpack to use the Plugin:\n\n   ```js\n   var SentryPlugin = require('webpack2-sentry-plugin');\n\n   var config = {\n     devtool: 'source-map', // Also possible: hidden-source-map\n     plugins: [\n       new SentryPlugin({\n         // Sentry options are required\n         organisation: 'your-organisation-name',\n         project: 'your-project-name',\n         apiKey: process.env.SENTRY_API_KEY,\n\n         // Release version name/hash is required\n         release: function() {\n           return process.env.GIT_SHA\n         },\n         // custom options, like refs to send to sentry\n         body: {\n           refs: [{\n             repository: 'project-repo',\n             commit: process.env.GIT_SHA\n           }]\n         }\n       })\n     ]\n   }\n   ```\n\nRecommended reading for sourcemaps: [webpack docs](https://webpack.js.org/configuration/devtool/), [Sentry docs](https://docs.sentry.io/clients/javascript/sourcemaps). If you are using the uglify plugin make sure that it is configured with ``sourcemaps: true``\n\n#### Options\n\n- `exclude`: RegExp to match for excluded files\n\n  ```js\n  var config = {\n    plugins: [\n      new SentryPlugin({\n        // Exclude uploading of html\n        exclude: /\\.html$/,\n        ...\n      })\n    ]\n  }\n  ```\n\n- `include`: RegExp to match for included files\n\n  ```js\n  var config = {\n    plugins: [\n      new SentryPlugin({\n        // Only upload foo.js \u0026 foo.js.map\n        include: /foo.js/,\n        ...\n      })\n    ]\n  }\n  ```\n\n- `filenameTransform`: Function to transform filename before uploading to Sentry. Defaults to prefixing filename with `~/`, which is used by Sentry as a [host wildcard](https://docs.sentry.io/clients/javascript/sourcemaps/#assets-multiple-origins)\n\n  ```js\n  var config = {\n    plugins: [\n      new SentryPlugin({\n        filenameTransform: function(filename) {\n          return 'a-filename-prefix-' + filename\n        }\n      })\n    ]\n  }\n  ```\n\n- `release`: Release name to attach source maps to. Can be string or function that returns a string. If a function is passed, it will receive the build hash as an argument\n\n```js\nvar config = {\n  plugins: [\n    new SentryPlugin({\n      release: function(hash) {\n        return hash\n      }\n    })\n  ]\n}\n```\n\n- `suppressErrors`: Display warnings instead of failing webpack build - useful in case webpack compilation is done during deploy on multiple instances\n\n- `baseSentryURL`: URL of Sentry instance. Shouldn't need to set if using sentry.io, but useful if self hosting\n\n- `organisation`: Sentry organisation to upload files to\n\n- `project`: Sentry project to upload files to\n\n- `apiKey`: Sentry api key ([Generate one here](https://sentry.io/api/))\n\n- `body`: custom body attributes to send to sentry. See https://docs.sentry.io/learn/releases for details.\n\n### Thanks\n\n- Thanks to [@MikaAK](https://github.com/MikaAK) for creating [s3-webpack-plugin](https://github.com/MikaAK/s3-plugin-webpack), which inspired much of this project\n- Thanks to [@danharper](https://github.com/danharper) for creating the original build script implementation\n\n### Contributing\n\nContributions are welcome 😄. To run the tests, please ensure you have the relevant environment variables set up. You can `cp .env.example .env` and fill it in with test account credentials. An API key can be created [here](https://sentry.io/api/), assuming you are signed in.\n\n#### Commands to be aware of\n\n*Warning* ⚠️: The test suite will create releases \u0026 upload files on Sentry. They should be cleaned up afterward, but ensure that you are not overwriting something important!\n\n- `npm test`: Runs the test suite\n- `npm run build`: Compiles distribution build\n\n#### Differences to original version\nThis plugin determines which sourcemap maps to which file and passes this information on to Sentry. That way you can freely rename sourcemaps. Support for devtool: hidden-sourcemap was also added.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalentinfunk%2Fwebpack2-sentry-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalentinfunk%2Fwebpack2-sentry-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalentinfunk%2Fwebpack2-sentry-plugin/lists"}