{"id":15292615,"url":"https://github.com/elmassimo/vite-plugin-bugsnag","last_synced_at":"2025-04-13T10:11:57.049Z","repository":{"id":41825917,"uuid":"360630967","full_name":"ElMassimo/vite-plugin-bugsnag","owner":"ElMassimo","description":"Report builds and upload source maps to Bugsnag","archived":false,"fork":false,"pushed_at":"2024-01-04T15:28:04.000Z","size":535,"stargazers_count":21,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-05T00:42:36.507Z","etag":null,"topics":["bugsnag","sourcemaps","vite-plugin","vitejs"],"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/ElMassimo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":".github/support.md","governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-04-22T17:37:22.000Z","updated_at":"2024-12-23T19:12:43.000Z","dependencies_parsed_at":"2024-02-24T23:32:30.618Z","dependency_job_id":"e541f1d2-63eb-4368-97bb-33a1d71fbec7","html_url":"https://github.com/ElMassimo/vite-plugin-bugsnag","commit_stats":{"total_commits":20,"total_committers":3,"mean_commits":6.666666666666667,"dds":0.09999999999999998,"last_synced_commit":"d4e26aa20d122c2991d087b8686cffc50e313333"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElMassimo%2Fvite-plugin-bugsnag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElMassimo%2Fvite-plugin-bugsnag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElMassimo%2Fvite-plugin-bugsnag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElMassimo%2Fvite-plugin-bugsnag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ElMassimo","download_url":"https://codeload.github.com/ElMassimo/vite-plugin-bugsnag/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248695481,"owners_count":21146956,"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":["bugsnag","sourcemaps","vite-plugin","vitejs"],"created_at":"2024-09-30T16:20:03.087Z","updated_at":"2025-04-13T10:11:57.023Z","avatar_url":"https://github.com/ElMassimo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch2 align='center'\u003e\u003csamp\u003evite-plugin-bugsnag\u003c/samp\u003e\u003c/h2\u003e\n\n\u003cp align='center'\u003eReport builds and upload source maps to \u003csamp\u003ebugsnag\u003c/samp\u003e\u003c/p\u003e\n\n\u003cp align='center'\u003e\n  \u003ca href='https://www.npmjs.com/package/vite-plugin-bugsnag'\u003e\n    \u003cimg src='https://img.shields.io/npm/v/vite-plugin-bugsnag?color=222\u0026style=flat-square'\u003e\n  \u003c/a\u003e\n  \u003ca href='https://github.com/ElMassimo/vite-plugin-bugsnag/blob/main/LICENSE.txt'\u003e\n    \u003cimg src='https://img.shields.io/badge/license-MIT-blue.svg'\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\n[vite-plugin-bugsnag]: https://github.com/ElMassimo/vite-plugin-bugsnag\n[migration]: https://vite-ruby.netlify.app/guide/migration.html#migrating-to-vite\n[vite.js]: http://vitejs.dev/\n[Bugsnag]: http://bugsnag.com/\n[webpack-bugsnag-plugins]: https://github.com/bugsnag/webpack-bugsnag-plugins\n[sourcemap]: https://vitejs.dev/config/#build-sourcemap\n[Vite Ruby]: https://vite-ruby.netlify.app/config/#source-maps-%F0%9F%97%BA\n\n## Why? 🤔\n\nThere is no official plugin from [Bugsnag] for [Vite.js].\n\nThis plugin provides the same functionality as \u003ckbd\u003e[webpack-bugsnag-plugins]\u003c/kbd\u003e in [Vite.js].\n\nThe API is similar to simplify the [migration] when moving away from Webpack.\n\n## Features ⚡️\n\n- 🔒 Written in TypeScript\n- 🚀 Quick setup with Vite plugins\n- 📖 Config options are fully documented in JSDoc\n\n## Installation 💿\n\nInstall the package as a development dependency:\n\n```bash\nnpm i -D vite-plugin-bugsnag # yarn add -D vite-plugin-bugsnag\n```\n\n## Usage 🚀\n\nTwo plugins are provided, one to report build information, and another one to upload sourcemaps.\n\nBoth plugins accept `apiKey`, `appVersion`, and `endpoint`, so you can share a config object.\n\nFor example:\n\n```js\nimport { defineConfig } from 'vite'\nimport { BugsnagBuildReporterPlugin, BugsnagSourceMapUploaderPlugin } from 'vite-plugin-bugsnag'\n\nconst isDistEnv = process.env.RAILS_ENV === 'production'\n\nconst bugsnagOptions = {\n  apiKey: process.env.BUGSNAG_API_KEY,\n  appVersion: process.env.APP_VERSION,\n}\n\nexport default defineConfig({\n  plugins: [\n    isDistEnv \u0026\u0026 BugsnagBuildReporterPlugin({ ...bugsnagOptions, releaseStage: process.env.RAILS_ENV }),\n    isDistEnv \u0026\u0026 BugsnagSourceMapUploaderPlugin({ ...bugsnagOptions, overwrite: true }),\n  ],\n})\n```\n\n\n### `BugsnagBuildReporterPlugin (options)`\n\nUse this plugin to report your application's build to Bugsnag.\n\n```js\nimport { defineConfig } from 'vite'\nimport { BugsnagBuildReporterPlugin } from 'vite-plugin-bugsnag'\n\nexport default defineConfig({\n  plugins: [\n    BugsnagBuildReporterPlugin({\n      apiKey: 'YOUR_API_KEY',\n      appVersion: '1.2.3',\n    }),\n  ],\n})\n```\n\n- It can auto detect source control from `.git`, `.hg` and `package.json`\n- Hooks into `writeBundle` to upload the information once the build is finished\n- If the build fails, the build report will not be sent\n\n### `BugsnagSourceMapUploaderPlugin (options)`\n\nUse this plugin to upload your application's sourcemaps to Bugsnag.\n\n```js\nimport { defineConfig } from 'vite'\nimport { BugsnagSourceMapUploaderPlugin } from 'vite-plugin-bugsnag'\n\nexport default defineConfig({\n  build: {\n    sourcemap: true,\n  },\n  plugins: [\n    BugsnagSourceMapUploaderPlugin({\n      apiKey: 'YOUR_API_KEY',\n      appVersion: '1.2.3',\n      base: 'https://your-app.xyz/assets/',\n    }),\n  ],\n})\n```\n\n- The plugin will enable [`build.sourcemap`][sourcemap] in order for Vite to [generate sourcemaps][Vite Ruby]\n- It will upload any generated sourcemaps to Bugsnag\n\n## License\n\nThis library is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felmassimo%2Fvite-plugin-bugsnag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felmassimo%2Fvite-plugin-bugsnag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felmassimo%2Fvite-plugin-bugsnag/lists"}