• Stars
    star
    18
  • Rank 1,208,065 (Top 24 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 3 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Report builds and upload source maps to Bugsnag

vite-plugin-bugsnag

Report builds and upload source maps to bugsnag


Why? πŸ€”

There is no official plugin from Bugsnag for Vite.js.

This plugin provides the same functionality as webpack-bugsnag-plugins in Vite.js.

The API is similar to simplify the migration when moving away from Webpack.

Features ⚑️

  • πŸ”’ Written in TypeScript
  • πŸš€ Quick setup with Vite plugins
  • πŸ“– Config options are fully documented in JSDoc

Installation πŸ’Ώ

Install the package as a development dependency:

npm i -D vite-plugin-bugsnag # yarn add -D vite-plugin-bugsnag

Usage πŸš€

Two plugins are provided, one to report build information, and another one to upload sourcemaps.

Both plugins accept apiKey, appVersion, and endpoint, so you can share a config object.

For example:

import { defineConfig } from 'vite'
import { BugsnagBuildReporterPlugin, BugsnagSourceMapUploaderPlugin } from 'vite-plugin-bugsnag'

const isDistEnv = process.env.RAILS_ENV === 'production'

const bugsnagOptions = {
  apiKey: process.env.BUGSNAG_API_KEY,
  appVersion: process.env.APP_VERSION,
}

export default defineConfig({
  plugins: [
    isDistEnv && BugsnagBuildReporterPlugin({ ...bugsnagOptions, releaseStage: process.env.RAILS_ENV }),
    isDistEnv && BugsnagSourceMapUploaderPlugin({ ...bugsnagOptions, overwrite: true }),
  ],
})

BugsnagBuildReporterPlugin (options)

Use this plugin to report your application's build to Bugsnag.

import { defineConfig } from 'vite'
import { BugsnagBuildReporterPlugin } from 'vite-plugin-bugsnag'

export default defineConfig({
  plugins: [
    BugsnagBuildReporterPlugin({
      apiKey: 'YOUR_API_KEY',
      appVersion: '1.2.3',
    }),
  ],
})
  • It can auto detect source control from .git, .hg and package.json
  • Hooks into writeBundle to upload the information once the build is finished
  • If the build fails, the build report will not be sent

BugsnagSourceMapUploaderPlugin (options)

Use this plugin to upload your application's sourcemaps to Bugsnag.

import { defineConfig } from 'vite'
import { BugsnagSourceMapUploaderPlugin } from 'vite-plugin-bugsnag'

export default defineConfig({
  build: {
    sourcemap: true,
  },
  plugins: [
    BugsnagSourceMapUploaderPlugin({
      apiKey: 'YOUR_API_KEY',
      appVersion: '1.2.3',
      base: 'https://your-app.xyz/assets/',
    }),
  ],
})

License

This library is available as open source under the terms of the MIT License.

More Repositories

1

vite_ruby

⚑️ Vite.js in Ruby, bringing joy to your JavaScript experience
Ruby
1,270
star
2

iles

🏝 The joyful site generator
TypeScript
1,074
star
3

vite-plugin-image-presets

πŸ–Ό Image Presets for Vite.js apps
TypeScript
246
star
4

vite-plugin-environment

Easily expose environment variables in Vite.js
TypeScript
144
star
5

vite-plugin-full-reload

♻️ Automatically reload the page when files are modified
JavaScript
134
star
6

oj_serializers

⚑️ Faster JSON serialization for Ruby on Rails. Easily migrate away from Active Model Serializers.
Ruby
113
star
7

js_from_routes

πŸ›£οΈ Generate path helpers and API methods from your Rails routes
Ruby
98
star
8

types_from_serializers

βœ… Generate TypeScript interfaces from your JSON serializers
Ruby
92
star
9

request_store_rails

πŸ“¦ Per-request global storage for Rails prepared for multi-threaded apps
Ruby
85
star
10

vuex-stores

πŸ—„ Store objects for Vuex, a simple and more fluid API for state-management.
JavaScript
62
star
11

vue-custom-element-example

An example on how to define custom elements using Vue 3
TypeScript
59
star
12

jekyll-vite

⚑️🩸 Use Vite.js in Jekyll as your assets pipeline
Ruby
50
star
13

vite-plugin-stimulus-hmr

⚑️ HMR for Stimulus controllers in Vite.js
TypeScript
50
star
14

mongoid_includes

🌿 Improves eager loading support for Mongoid
Ruby
46
star
15

stimulus-vite-helpers

Helpers to easily load all your Stimulus controllers when using Vite.js
TypeScript
43
star
16

queryable

❔ Gives your queries a home and avoid tucking scopes inside your models
Ruby
42
star
17

capybara-compose

βœ… Easily write fluent integration tests with Capybara in Ruby
Ruby
32
star
18

better_settings

βš™ Settings for Ruby apps – fast, immutable, better.
Ruby
20
star
19

i18n_multitenant

🌎 Provides a convenient way to use tenant-specific translations
Ruby
18
star
20

vite-plugin-manifest-sri

Subresource Integrity for Vite.js manifest files
JavaScript
15
star
21

resourcerer

✨ Works like magic to dry up your controllers
Ruby
10
star
22

sublime-toggle-dark-mode

🌚🌞 Toggle between dark and light mode in Sublime Text 4
JavaScript
10
star
23

pakiderm

🐘 Pakiderm will never forget the return value
Ruby
7
star
24

presenter_rails

πŸ”­ Expose your view models in a convenient way
Ruby
6
star
25

vite-plugin-erb

Use ERB files in Vite.js projects with a Ruby backend
TypeScript
5
star
26

journeyman

Let your factories use your business logic, making them flexible and easier to update.
Ruby
5
star
27

jekyll-vite-minima

⚑️🩸 Use Vite.js in Jekyll minima theme as your assets pipeline
Ruby
3
star
28

automatic-music-transcription

Automatically exported from code.google.com
C
2
star
29

vite-plugin-xdm

Use XDM in VIte.js
JavaScript
2
star
30

fast-food-mvc

Automatically exported from code.google.com
C#
1
star
31

ElMassimo

1
star
32

vite-vue-router-hmr-repro

Vue
1
star
33

crouton

🍞 Context sensitive notifications for Rails
Ruby
1
star