@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
AFFiNE
Productivity · Project Management · Note Taking
Write, draw, and plan in one infinite canvas — the open-source alternative to Notion and Miro that keeps your data yours.
AionUi
AI Agents · Productivity
Free, open-source Cowork desktop app that unifies Claude Code, Codex, Gemini CLI, and 20+ AI agents into a single platform with multi-agent teams, 24/7 cron automation, and zero-config built-in agent.
BrowserOS
Browser · AI Assistants
The open-source agentic Chromium browser with native AI agents, MCP server, and visual workflow automation — your data never leaves your machine.
CodeSandbox
Code Editors · Developer Tools
Instantly ready browser-based IDE that runs full npm dependency resolution and transpilation entirely client-side, with no server needed.
Element Web
Team Chat · Collaboration
A polished, self-hostable Matrix client for secure, decentralized messaging and collaboration that puts your organization in full control of its data.
Enso
Analytics · Data Engineering · Low Code Platforms
A visual and textual programming platform for data prep and analysis where the node graph and the underlying Enso code are always perfectly in sync, built by an Alteryx co-founder on a GraalVM engine.
Flagsmith
Developer Tools · Devops · Ab Testing Experimentation
Open-source feature flagging, remote config, and A/B/multivariate testing platform for web, mobile, and server-side apps — self-host or use the hosted SaaS.
Ghost
CMS · Blogging
Open source headless Node.js CMS for professional publishing, paid memberships, and newsletters with a fully owned audience.
Hatchet
AI Development · Developer Tools · Automation
A Postgres-backed orchestration engine for background tasks, AI agents, and durable workflows that replaces Redis queues and multi-datastore durable execution platforms with a single self-hostable service.