@sentry/vite-plugin
Official Vite plugin that uploads source maps and manages releases directly to Sentry at build time.
Repository Health
Technical Analysis
@sentry/vite-plugin is Sentry’s officially maintained Vite integration for source map upload and release management. Dropped into a Vite (or Vue/React/etc. via Vite) build pipeline, it uploads generated source maps to Sentry after each build, creates and finalizes a release, and associates the deploy with that release so stack traces captured in production resolve back to original source rather than minified bundles.
The package is one of four thin bundler-specific adapters (alongside esbuild, Rollup, and Webpack plugins) inside the sentry-javascript-bundler-plugins monorepo. Its own source is a single re-export line — the actual upload, release, and CI-detection logic lives in a shared @sentry/bundler-plugins core package that is in the process of moving into Sentry’s main sentry-javascript monorepo ahead of a planned v11 consolidation, so behavior stays identical across every supported bundler.
What You Get
- Automatic source map upload to Sentry after a Vite production build, with cleanup of the generated maps so they aren’t shipped to end users
- Release creation and finalization in Sentry, tied to the current deploy
- Automatic release-name discovery from CI environment variables (Vercel, AWS, Heroku, CircleCI) or the current git SHA, with no manual configuration required
- Multi-project support — upload the same build’s source maps to several Sentry projects from one plugin config
- Optional Babel-based React component-name annotation for clearer breadcrumbs and Session Replay recordings
- A
.env.sentry-build-pluginfile convention so auth tokens and org/project settings can live outsidevite.config.ts
Common Use Cases
- Wiring up production error tracking for a Vite-built SPA so Sentry shows real file/line numbers instead of minified output
- Tagging every production deploy with a Sentry release so errors can be bisected to the commit or deployment that introduced them
- Uploading source maps for a multi-team app to several Sentry projects (e.g. per-team or per-tenant) from a single build
- Improving React error triage by annotating breadcrumbs and replays with actual component names instead of generic anonymous function frames
Under The Hood
Architecture
Sentry’s Vite plugin is one of several thin per-bundler adapter packages (esbuild-plugin, rollup-plugin, webpack-plugin, vite-plugin) inside an Nx-orchestrated monorepo; each adapter’s src/index.ts does nothing but re-export the actual plugin factory from the external @sentry/bundler-plugins package (itself recently merged from the former @sentry/bundler-plugin-core and @sentry/babel-plugin-component-annotate), which now lives in Sentry’s main sentry-javascript monorepo ahead of a planned v11 consolidation. The Vite-specific surface area is limited to packaging: a Rolldown-based build config emits dual ESM/CJS bundles plus type declarations, and a prepack script regenerates the package README from a template by splicing in an auto-generated CLI-options table sourced from a shared internal dev-utils package. Cross-bundler behavior (source map upload, release creation, CI-based release-name discovery, component-name annotation) is implemented once in the shared core and consumed identically by all four adapters, so a change to upload logic reaches Vite, Webpack, Rollup, and esbuild simultaneously without touching this package’s own source.
Tech Stack
TypeScript targeting Node 18+, built with Rolldown (Rollup’s Rust-based successor), orchestrated across the workspace by Nx with build-output caching; linting and formatting run through the Oxc toolchain (oxlint/oxfmt) rather than ESLint/Prettier, and package management is Yarn workspaces spanning seven packages (dev-utils, esbuild-plugin, playground, rollup-plugin, vite-plugin, webpack-plugin, integration-tests-next). The plugin’s only runtime dependency is the shared @sentry/bundler-plugins package, which itself wraps Sentry’s CLI/API for source map and release operations.
Code Quality
The vite-plugin package itself ships no unit tests of its own — its test directory holds only a TypeScript config, reflecting the ongoing migration of core logic and its test suite out to the sentry-javascript monorepo. Vite-specific integration coverage instead comes from a sibling integration-tests-next package, which runs fixture-based builds (multi-page-app scenarios, source map assertions) against several separately installed major versions of Vite to catch bundler API drift across releases. Type checking is enforced separately for source and test code, CI runs lint/build/test/CodeQL on every change, and a dedicated license-compliance workflow gates new dependencies.
API Design
The public surface is a single plugin-factory call (sentryVitePlugin({...})) dropped into a Vite config’s plugins array, with its options table auto-generated into the README from a shared schema so all four bundler adapters stay documented consistently. The plugin follows the same shape as competing error-tracking bundler integrations — upload maps, create a release, tag a deploy — rather than introducing a new technique; its most distinguishing conveniences are configuration-free release-name discovery across major CI providers, first-class multi-project upload from one config block, and an opt-in component-name annotation pass that most competing SDKs don’t offer.
Used by 29 apps in this directory
OpnForm
Forms Surveys · Marketing
Build unlimited, embeddable forms with no code — powered by AI, logic rules, and real-time analytics
Refly
AI Development · Automation · No Code Platforms
Build deterministic, versioned agent skills from natural language—run them anywhere from Claude Code to Slack.
Rivet
AI Agents · Developer Tools
Stateful actors as a primitive for AI agents, real-time collaboration, and durable execution — with in-memory state, WebSockets, queues, and scheduling built in.
Sentry
Analytics · Developer Tools · Monitoring
Developer-first error tracking and performance monitoring platform with AI-powered root-cause analysis across 20+ languages and frameworks.
SigNoz
Analytics · Monitoring
Self-host your entire observability stack — logs, metrics, traces, and LLM monitoring — in one OpenTelemetry-native platform, without the Datadog bill.
superset
AI Code Assistants · AI Development
Orchestrate an army of AI coding agents—Claude Code, Codex, Gemini CLI, and more—running simultaneously in isolated git worktrees from a single Electron desktop app.
Tolgee
Developer Tools
In-context localization platform that lets developers and translators edit app strings directly in the running application, with AI-powered machine translation and framework SDKs for React, Angular, Vue, and Svelte.
ToolJet
AI Agents · Low Code Platforms · No Code Platforms
Open-source AI-native platform to build and deploy internal tools, workflows, and AI agents with a visual drag-and-drop builder and 80+ data source integrations.
Vibe Kanban
AI Agents · AI Code Assistants · Project Management
A kanban board for planning work and dispatching Claude Code, Codex, Gemini CLI, and eight other coding agents into isolated git worktrees, then reviewing and merging their diffs from one UI.