vite-plugin-sentry weekly downloads statistics
By ikenfin · npm · Vite plugins
The unofficial Sentry plugin for Vite ⚡️
vite-plugin-sentry has 13,534 recorded weekly downloads on npm, a decrease of 19.5% over the past 30 days, ranking #1170 of 3,247 tracked listings.
About vite-plugin-sentry
Plugin for Vite ⚡️ to create releases and upload sourcemaps to Sentry
This plugin hooks into the Vite build step, to create a new release and upload source maps. It does not instrument error reporting in your app.
It's a port of official Sentry webpack plugin for Vite.
It's fully written on Typescript and there is some differences in configuration, described below, but we mostly follow @sentry/cli types.
Install
yarn add -D vite-plugin-sentry
Configuration
If you using Typescript - you can use ViteSentryPluginOptions type for better configuration experience with autocomplete.
Example config:
// vite.config.ts
// other declarations
import type { ViteSentryPluginOptions } from 'vite-plugin-sentry'
import viteSentry from 'vite-plugin-sentry'
/*
Configure sentry plugin
*/
const sentryConfig: ViteSentryPluginOptions = {
url: 'https://sentry.io',
authToken: '<SECRET_TOKEN_HERE>',
org: 'my_org',
project: 'my_project',
release: '1.0',
// legacyErrorHandlingMode: true, <- warn about sentry errors instead of fail
// cleanSourcemapsAfterUpload: true, <- delete generated sourcemap files after complete
deploy: {
env: 'production'
},
setCommits: {
auto: true
},
sourceMaps: {
include: ['./dist/assets'],
ignore: ['node_modules'],
urlPrefix: '~/assets'
}
}
export default defineConfig({
// other options
plugins: [ viteSentry(sentryConfig) ],
build: {
// required: tells vite to create source maps
sourcemap: true,
}
})
Possible breaking change!
From version 1.2.0 we have changed default error handling. Now if Sentry report error while uploading sourcemaps - we crash whole build process instead of just print warning. This was done to prevent calling next to && operator on uploading error.
You can enable legacy mode using legacyErrorHandlingMode: true in plugin config.
Wiki
Check project wiki on github to get more information.
Share config with Sentry client library
To correctly work with Sentry, you need to add a release to your project. Same about dist option: your uploaded sourcemaps and client sentry initialization must have same release/dist to make sentry correct recognize and bind sourcemaps to logged errors.
You can expose release and dist options used by vite-plugin-sentry into your application using Vite feature known as virtual module.
To do so, you need to add several lines:
// import virtual module
// i would recommend doing it at entry point script (e.g. main.js)
import 'virtual:vite-plugin-sentry/sentry-config'
// now you can use this variable like so
const dist = import.meta.env.VITE_PLUGIN_SENTRY_CONFIG.dist
const release = import.meta.env.VITE_PLUGIN_SENTRY_CONFIG.release
// use it in sentry init
Sentry.init({
// other sentry options
dist,
release
})
// also, these settings exposed to globalThis object
// so you can get them from window object:
const dist = window.VITE_PLUGIN_SENTRY_CONFIG.dist
const release = window.VITE_PLUGIN_SENTRY_CONFIG.release
TypeScript
To get type information for the virtual module or import meta env, you can add vite-plugin-sentry/client to your types array in tsconfig.json.
{
"types": [
"vite-plugin-sentry/client"
]
}
Also you can use reference in your typescript code like below:
///<reference types="vite-plugin-sentry/client"/>
Common how to:
Delete generated source maps after upload (#1)
UPD: From version 1.2.1 you can use new configuration option cleanSourcemapsAfterUpload to clean sourcemap files.
While i recommend to use CI, you can also use tools like rimraf in your npm scripts to drop any unnecessary files after build was complete:
// package.json
{
"scripts": {
// delete all js map files when built
"build": "vite build && rimraf dist/**/*.js.map"
}
}
Cannot install on Windows
This plugin relies on @sentry/cli tool, which requires VCRedist to be installed. Please check #8 for details.
List of available options
Here are the list of all plugin options:
Legend:
❌ - NOT required
⚠️ - NOT required in plugin config, but MUST be set (for example, using .sentryclirc file)
✅ - Required…
Description from the npm listing.
- vite-plugin
- sentry
- sentry-cli
- sourcemap
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (591)Similar npm Vite plugins plugins
All 20 vite-plugin-sentry alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/vite-plugin-sentry. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.