{"id":15287111,"url":"https://github.com/kricsleo/unplugin-sentry","last_synced_at":"2025-06-30T06:34:34.627Z","repository":{"id":61207028,"uuid":"548336470","full_name":"kricsleo/unplugin-sentry","owner":"kricsleo","description":"🪜 All-in-one plugin for sentry, support webpack \u0026 vite \u0026 rollup \u0026 nuxt.","archived":false,"fork":false,"pushed_at":"2024-09-06T09:53:06.000Z","size":911,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-16T11:39:49.378Z","etag":null,"topics":["plugin","rollup","sentry","vite","webpack"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/kricsleo.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,"zenodo":null}},"created_at":"2022-10-09T11:09:13.000Z","updated_at":"2024-12-02T17:20:41.000Z","dependencies_parsed_at":"2024-01-24T05:25:12.432Z","dependency_job_id":"e65d2151-93bd-4adf-8052-647d537f4d38","html_url":"https://github.com/kricsleo/unplugin-sentry","commit_stats":{"total_commits":29,"total_committers":2,"mean_commits":14.5,"dds":0.03448275862068961,"last_synced_commit":"8fb7a883b606cc3df98bcd0bbb038d8f9eec09bc"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/kricsleo/unplugin-sentry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kricsleo%2Funplugin-sentry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kricsleo%2Funplugin-sentry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kricsleo%2Funplugin-sentry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kricsleo%2Funplugin-sentry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kricsleo","download_url":"https://codeload.github.com/kricsleo/unplugin-sentry/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kricsleo%2Funplugin-sentry/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260857231,"owners_count":23073423,"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":["plugin","rollup","sentry","vite","webpack"],"created_at":"2024-09-30T15:24:19.636Z","updated_at":"2025-06-30T06:34:34.596Z","avatar_url":"https://github.com/kricsleo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eunplugin-sentry\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://www.npmjs.com/package/unplugin-sentry\"\u003e\n  \u003cimg src=\"https://img.shields.io/npm/v/unplugin-sentry?style=flat\u0026colorA=18181B\u0026colorB=F0DB4F\" /\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://www.npmjs.com/package/unplugin-sentry\"\u003e\n  \u003cimg src=\"https://img.shields.io/npm/types/unplugin-sentry?style=flat\u0026colorA=18181B\u0026colorB=F0DB4F\" /\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://github.com/kricsleo/unplugin-sentry/blob/master/LICENSE\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/license/kricsleo/unplugin-sentry.svg?style=flat\u0026colorA=18181B\u0026colorB=F0DB4F\" /\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch3 align=\"center\"\u003e\nAll-in-one plugin for Sentry, supports webpack, vite, rollup, nuxt .ect.\n\u003c/h3\u003e\nIt's used to upload sourcemap and release your project to Sentry ([What's Sentry?](https://sentry.io/welcome/)).\n\n## Features\n\n- 🪜 Supports multiple bundlers and frameworks - including webpack, vite, rollup, nuxt and so on.\n- ✨ Auto-detect configs depending on current environment - config as less as you need\n- 🧹 Auto clean local soucemap files after upload (For security) - both `*.js.map` and `*.css.map`.\n- 🍬 Optional runtime provided - easy to init Sentry at runtime.\n\n## Install\n\n```bash\nnpm i unplugin-sentry -D\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eVite\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// vite.config.ts\nimport unpluginSentry from 'unplugin-sentry/vite'\n\nexport default defineConfig({\n  plugins: [\n    unpluginSentry({ /* options */ }),\n  ],\n})\n```\n\nExample: [`playground/vite`](./playground/vite)\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eRollup\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// rollup.config.js\nimport unpluginSentry from 'unplugin-sentry/rollup'\n\nexport default {\n  plugins: [\n    unpluginSentry({ /* options */ }),\n  ],\n}\n```\n\nExample: [`playground/rollup`](./playground/rollup)\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eWebpack\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// webpack.config.js\nmodule.exports = {\n  /* ... */\n  plugins: [\n    require('unplugin-sentry/webpack')({ /* options */ })\n  ]\n}\n```\n\nExample: [`playground/webpack`](./playground/webpack)\n\n\u003e This module works for Webpack \u003e= 3\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eNuxt\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// nuxt.config.js\nexport default {\n  buildModules: [\n    ['unplugin-sentry/nuxt', { /* options */ }],\n  ],\n}\n```\n\nExample: [`playground/nuxt`](./playground/nuxt)\n\n\u003e This module works for both Nuxt 2 and [Nuxt Vite](https://github.com/nuxt/vite)\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eVue CLI\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// vue.config.js\nmodule.exports = {\n  configureWebpack: {\n    plugins: [\n      require('unplugin-sentry/webpack')({ /* options */ }),\n    ],\n  },\n}\n```\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eesbuild\u003c/summary\u003e\u003cbr\u003e\n\nI don't use esbuild for now, so it haven't been tested in esbuild yet.\n(You can have a try and tell me if it works 👂. )\n\n\u003cbr\u003e\u003c/details\u003e\n\n## Runtime Support\n\nBesides uploading sourcemap to Sentry and other publishing works, this plugin also injects a virtual module named `virtual-unplugin-sentry-runtime` into your project.\n\nIt provides some useful meta info when initing Sentry at runtime. For example, when you call `Sentry.init({/** options **/})`, the `environment` and `release` options must match the one you use when uploading sourcemap. So that when debugging the issue in Sentry, the sourcemap can be correctly mapped.\n\n```ts\nimport * as sentryMeta from 'virtual-unplugin-sentry-runtime'\n\nconsole.log(sentryMeta)\n// {\n//   ORG: string\n//   PROJECT: string\n//   ENV: string\n//   RELEASE: string\n//   DIST: string\n//   PUBLISH: boolean\n// }\n```\n\nNeed TS support for this runtime module? Just add the following config to your `tsconfig.json`.\n\n```json\n{\n  \"compilerOptions\": {\n    \"types\": [\"unplugin-sentry/runtime\"]\n  }\n}\n```\n\n## Options\n\nExtends from [@sentry/cli - SentryCliOptions](https://github.com/getsentry/sentry-cli/blob/master/js/index.d.ts#L5).\n\n| Prop            | Type      | Required | Default | Description                                                                                                            |\n|-----------------|-----------|----------|---------|------------------------------------------------------------------------------------------------------------------------|\n| url             | `string`  | ❌       | `https://sentry.io/`     | The URL of the Sentry instance you are connecting to. \u003cbr \u003e This value will update `SENTRY_URL env variable.                                 |\n| org             | `string`  | ❌       | -     | Organization slug. \u003cbr \u003e This value will update `SENTRY_ORG` env variable.                                                                                                     |\n| project         | `string`  | ❌       | -     | Project Project slug. \u003cbr \u003e This value will update `SENTRY_PROJECT` env variable.                                                                                                 |\n| authToken       | `string`  | ❌       | -     | Authentication token for API, interchangeable with apiKey. \u003cbr \u003e This value will update `SENTRY_AUTH_TOKEN` env variable.                                                            |\n| publish         | `boolean` | ❌       | `false` | If publish project to Sentry.\u003cbr \u003e Means to upload soucemap files and release the version to Sentry server.\u003cbr \u003e You might want to turn it on only when deploying projects other than locally developing.\n| release         | `string`  | ❌       | -     | Release version.\u003cbr \u003e Automatically generated from commit hash value if not provided.                                         |\n| shortRelease    | `boolean` | ❌       | `true`  | If use short commit hash for automatically generated release version.                                                  |\n| cleanLocal      | `boolean` | ❌       | `true`  | If remove local sourcemap files (`*.js.map` \u0026 `*.css.map`) after the publish.                                                                     |\n| cleanArtifacts  | `boolean` | ❌       | `false` | If remove previous artifacts in the same release.                                                                      |\n| sourcemap       | [`SourcemapOptions`](#sourcemapoptions) | ❌  | -     | Sourcemap options.                                                                                                     |\n| deploy          | [`DeployOptions`](#deployoptions)    | ❌  | -     | Deploy options.                                                                                                        |\n| commits         | [`CommitsOptions`](#commitsoptions)   | ❌  | -     | Commits options.                                                                                                       |\n| finalize        | `boolean` | ❌       | `true`  | If finalize a release after the publish.                                                                               |\n| silent          | `boolean` | ❌       | `false` | If true, all logs are suppressed.                                                                                      |\n| dryRun          | `boolean` | ❌       | `false` | If attempts a dry run. \u003cbr \u003e Usually used for debugging which mocks publishing.                                                                                              |\n| configFile      | `string`  | ❌       | -     | Path of Sentry config file.                                                                                            |\n\n#### SourcemapOptions\n\nExtends from [@sentry/cli - SentryCliUploadSourceMapsOptions](https://github.com/getsentry/sentry-cli/blob/master/js/index.d.ts#L64).\n\n| Prop                 | Type             | Required | Default     | Description                                                                                        |\n|----------------------|------------------|----------|-------------|----------------------------------------------------------------------------------------------------|\n| include              | `Array\u003cstring \\| SourceMapsPathDescriptor\u003e`  | ❌       | - \u003cbr \u003e Auto-detectd from current bundler(webpack, vite, rollup and so on).       | One or more paths that Sentry CLI should scan recursively for sources. \u003cbr \u003e It will upload all .map files and match associated .js files. \u003cbr \u003e `type SourceMapsPathDescriptor = Omit\u003cSourcemapOptions, 'include'\u003e \u0026 { paths: string[] }`                     |\n| urlPrefix            | `string`         | ❌       | - \u003cbr \u003e Auto-detectd from current bundler(webpack, vite, rollup and so on).        | This sets an URL prefix at the beginning of all files. \u003cbr \u003e This is also useful if your files are stored in a sub folder. **BUT REMEMBER TO START WITH `~/`.** eg: url-prefix `~/static/js`.                                           |\n| urlSuffix            | `string`         | ❌       | -         | This sets an URL suffix at the end of all files. \u003cbr \u003e Useful for appending query parameters.                                                  |\n| ignore               | `string[]`       | ❌       | -         | One or more paths to ignore during upload. Overrides entries in ignoreFile file.                   |\n| ignoreFile           | `string` \\| `null` | ❌    | -         | Path to a file containing list of files/directories to ignore. \u003cbr \u003e Can point to .gitignore or anything with same format.                                    |\n| dist                 | `string`         | ❌       | -         | Unique identifier for the distribution, used to further segment your release. \u003cbr \u003e Usually your build number.\n| rewrite            | `boolean`                                   | ❌       | `true`    | Enables rewriting of matching sourcemaps so that indexed maps are flattened and missing sources are inlined if possible.                        |\n| sourceMapReference | `boolean`                                   | ❌       | -       | This prevents the automatic detection of sourcemap references.                                                                                  |\n| stripPrefix        | `string[]`                                  | ❌       | -       | When paired with the rewrite option this will remove a prefix from uploaded files. \u003cbr \u003e For instance you can use this to remove a path that is build machine specific.                                                             |\n| stripCommonPrefix  | `boolean`                                   | ❌       | -       | When paired with the rewrite option this will add ~ to the stripPrefix array.                                                                   |\n| validate           | `boolean`                                   | ❌       | -       | This attempts sourcemap validation before upload when rewriting is not enabled. \u003cbr \u003e It will spot a variety of issues with source maps and cancel the upload if any are found. \u003cbr \u003e This is not enabled by default as this can cause false positives.                                                                |\n| ext                | `string[]`                                  | ❌       | -       | This sets the file extensions to be considered. By default the following file extensions are processed: js, map, jsbundle and bundle.           |\n\n#### DeployOptions\n\nExtends from [@sentry/cli - SentryCliNewDeployOptions](https://github.com/getsentry/sentry-cli/blob/master/js/index.d.ts#L126).\n\n| Prop      | Type      | Required | Default | Description                                                                                                       |\n|-----------|-----------|----------|---------|-------------------------------------------------------------------------------------------------------------------|\n| env       | `string`  | ❌       | - \u003cbr \u003e Auto-detectd from current bundler(webpack, vite, rollup and so on) and use \"process.env.NODE_ENV\" as fallback.    | Environment for this release. Values that make sense here would be `production` or `staging`.                    |\n| started   | `number` \\| `string`  | ❌       | -     | Deployment start time in Unix timestamp (in seconds) or ISO 8601 format.                                         |\n| finished  | `number` \\| `string`  | ❌       | -     | Deployment finish time in Unix timestamp (in seconds) or ISO 8601 format.                                         |\n| time      | `number`  | ❌       | -     | Deployment duration (in seconds). Can be used instead of started and finished.                                    |\n| name      | `string`  | ❌       | -     | Human readable name for the deployment.                                                                           |\n| url       | `string`  | ❌       | -     | URL that points to the deployment.                                                                                |\n\n#### CommitsOptions\n\nExtends from [@sentry/cli - SentryCliCommitsOptions](https://github.com/getsentry/sentry-cli/blob/master/js/index.d.ts#L153).\n\n| Prop            | Type      | Required | Default | Description                                                                                                        |\n|-----------------|-----------|----------|---------|--------------------------------------------------------------------------------------------------------------------|\n| auto            | `boolean` | ❌       | -     | Automatically choose the associated commit (uses the current commit). Overrides other setCommit options.           |\n| repo            | `string`  | ❌       | -     | The full repo name as defined in Sentry. Required if auto option is not true.                                      |\n| commit          | `string`  | ❌       | -     | The current (last) commit in the release. Required if auto option is not true.                                     |\n| previousCommit  | `string`  | ❌       | -     | The commit before the beginning of this release. \u003cbr \u003e If omitted, this will default to the last commit of the previous release in Sentry. \u003cbr \u003e If there was no previous release, the last 10 commits will be used.                                                                |\n| ignoreMissing   | `boolean` | ❌       | -     | When the flag is set and the previous release commit was not found in the repository, will create a release. \u003cbr \u003e with the default commits count(or the one specified with `--initial-depth`) instead of failing the command.     |\n| ignoreEmpty     | `boolean` | ❌       | -     | When the flag is set, command will not fail and just exit silently if no new commits for a given release are found.|\n\n## License\n\n[MIT](./LICENSE) License © 2021-Present [kricsleo](https://github.com/kricsleo)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkricsleo%2Funplugin-sentry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkricsleo%2Funplugin-sentry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkricsleo%2Funplugin-sentry/lists"}