@rolldown/plugin-babel

Official Babel transform plugin for Rolldown and Vite, with per-file preset filtering.

Library
npm
v0.2.3
18stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
65/100Good
Development Activity92
Maintenance100
Community20
Maturity28
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
80/100Excellent
Architecture80
Code Quality90
Innovation78
Learning Curve70

@rolldown/plugin-babel is the official Babel integration for Rolldown, the Rust-based bundler that powers Vite’s next-generation build pipeline. It runs Babel’s transform pass over .js, .jsx, .ts, and .tsx files, automatically wiring up the correct parser plugins so consumers don’t need to hand-configure Babel’s parser options for each file type.

Beyond a drop-in Babel-in-Rolldown bridge, the plugin adds a RolldownBabelPreset abstraction that lets a single Babel preset apply conditionally to a subset of files (by path, Rolldown module type, or file content) instead of running against every module. Those per-preset filters are compiled once and unioned into Rolldown’s native transform-hook filter, so files that no preset would touch never even reach the JavaScript transform callback. It also understands Vite’s multi-environment builds, supports both Babel 7 and Babel 8 through a type-safe compatibility layer, and can automatically wire in @babel/plugin-transform-runtime to deduplicate Babel’s helper functions across a project.

What You Get

  • A Rolldown/Vite plugin that runs Babel transforms with automatic JSX/TS/TSX parser configuration
  • Dual Babel 7 and Babel 8 compatibility via a type-safe compat layer, with no consumer-side branching required
  • Per-preset conditional application via defineRolldownBabelPreset, filtering by file path, Rolldown module type, or file content
  • Optional automatic @babel/plugin-transform-runtime wiring for deduplicated Babel helper output
  • Vite-aware per-environment (applyToEnvironmentHook) and resolved-config-aware (configResolvedHook) preset gating

Common Use Cases

  • Adding a Babel plugin or preset (e.g. decorators, throw-expressions) to a Rolldown or Vite build that Rolldown doesn’t transform natively
  • Applying different Babel presets to different file types or Vite environments (client vs SSR) in the same build
  • Migrating an existing rollup-plugin-babel configuration to Rolldown
  • Deduplicating Babel helper code across a large codebase via the runtimeVersion option

Under The Hood

Architecture The plugin implements the Rolldown/Vite plugin lifecycle (config, configResolved, applyToEnvironment, outputOptions, transform) in index.ts, delegating option merging to options.ts (resolveOptions, createBabelOptionsConverter), transform-hook filter computation to filter.ts (calculateTransformFilter, which unions and intersects HookFilter dimensions — id, moduleType, code — across every registered RolldownBabelPreset), and Babel 7/8 type compatibility to babelCompat.ts. An envState map keyed by Vite environment name lets multi-environment builds carry distinct, pre-compiled Babel option converters computed once at configResolved/applyToEnvironment time and reused on every subsequent transform call, keeping the per-file hot path free of repeated filter recompilation.

Tech Stack Written in TypeScript and published as ESM-only (type: module, single dist/index.mjs entry), built with tsdown and tested with Vitest as part of the rolldown/plugins pnpm monorepo, which shares Rolldown and Vite dev-dependency versions across packages via a pnpm catalog. The only runtime dependency is picomatch for glob-style path matching; @babel/core, @babel/plugin-transform-runtime, @babel/runtime, rolldown, and vite are all peer dependencies, with the Babel runtime helpers and Vite itself marked optional so the plugin stays usable in pure-Rolldown builds without Vite.

Code Quality The package carries an extensive test suite relative to its size — over 1,700 lines across filter.test.ts, index.test.ts, and rolldownPreset.test.ts — exercising real Rolldown and Vite builds rather than mocking the bundler, including override merging, multi-dimension preset filtering, per-environment behavior, and Babel error propagation. The monorepo enforces oxlint --type-aware --type-check and oxfmt formatting repo-wide, plus CI workflows for linting, GitHub Actions security scanning (zizmor), and automated releases. Babel’s incompatible v7/v8 types are handled explicitly through conditional types rather than any-casting past the problem.

What Makes It Unique The standout design choice is RolldownBabelPreset: instead of a preset applying unconditionally to every file, it carries its own filter (by path, Rolldown module type, or matched code) that the plugin compiles once and unions across all registered presets into Rolldown’s native transform-hook filter — meaning files no preset would touch skip the JS transform callback entirely, a genuine performance win specific to Rolldown’s filter-hook API rather than something bolted on afterward. Layered on top of that is Vite-specific environment and resolved-config gating for presets, and a from-scratch Babel 7/8 compatibility shim built on TypeScript conditional types so the same plugin code works against either major version’s API and type surface.

Used by 13 apps in this directory

TypeScript
94%
MIT

Actual

Invoicing Finance

28,593

Local-first personal finance with envelope budgeting, end-to-end encryption, and multi-device sync — no subscription required.

View details
93
Repo Health
85
Technical
77
Dependency
Built with
TypeScript94%
Updated today
Python
90%
Apache 2.0

Apache Airflow

Data Engineering

46,755

Define, schedule, and monitor complex data workflows as Python code — with a powerful UI, 80+ provider integrations, and battle-tested scalability across thousands of production deployments.

View details
96
Repo Health
89
Technical
64
Dependency
Built with
Python90%
Updated yesterday
TypeScript
53%
MIT

Anarlog

Note Taking · AI Assistants · Productivity

9,252

Anarlog is an open-source, local-first AI meeting notetaker that records, transcribes, and summarizes meetings entirely on your device — no cloud lock-in, no mandatory account, and every note saved as a plain markdown file you own forever.

View details
86
Repo Health
77
Technical
68
Dependency
Built with
TypeScript53%
Rust35%
Updated today
Java
73%
Other

ByteChef

Automation · AI Agents

1,000

Unified open-source platform for AI agent orchestration and workflow automation with 180+ connectors, MCP support, and durable execution.

View details
85
Repo Health
82
Technical
70
Dependency
Built with
Java73%
TypeScript26%
Updated yesterday
Go
75%
AGPL 3.0

Coder

Devops · Developer Tools · Code Editors

14,385

Self-hosted cloud development environments and AI coding agents — defined in Terraform, connected via WireGuard, automatically shut down when idle.

View details
93
Repo Health
90
Technical
68
Dependency
Built with
Go75%
TypeScript23%
Updated today
Go
69%
MIT

Gotify

Monitoring · Developer Tools

15,859

A lightweight, self-hosted push notification server that sends and receives messages in real time over WebSocket, with a sleek web UI and a native Go plugin system.

View details
90
Repo Health
74
Technical
69
Dependency
Built with
Go69%
TypeScript30%
Updated yesterday
TypeScript
97%
MIT

likec4

Developer Tools · Devops

5,634

Define your software architecture as code and get always up-to-date, interactive C4 diagrams generated automatically from a DSL.

View details
89
Repo Health
83
Technical
77
Dependency
Built with
TypeScript97%
Updated yesterday
Ruby
59%
AGPL 3.0

Mastodon

Social Media

50,274

Run your own federated social network on the open ActivityPub standard with no ads, no algorithms, and no corporate control over your community.

View details
95
Repo Health
81
Technical
70
Dependency
Built with
Ruby59%
TypeScript23%
Updated yesterday
Go
51%
MIT

memos

Note Taking

62,805

Open-source, self-hosted note-taking built for quick capture — Markdown-native, lightweight, and fully yours.

View details
91
Repo Health
78
Technical
66
Dependency
Built with
Go51%
TypeScript48%
Updated yesterday

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search