Skip to content

What is Vantris?

Vantris is a modern, fast bundler and dev server for JavaScript, TypeScript, and React. It gives you the whole development cycle behind three commands — dev, build, and preview — with an instant dev server, Hot Module Replacement, and optimised production builds. It runs on Node.js and Bun, transpiles TypeScript and JSX on the fly, and pre-bundles npm dependencies on demand. Zero config to start.

bash
npm install -D vantris

One tool, three commands

A Vantris project is nothing more than an index.html with a module-script entry. From there, everything happens through three verbs:

CommandWhat it does
vantris devInstant dev server with HMR → http://localhost:3000
vantris buildOptimised production build → dist/
vantris previewServes the finished build → http://localhost:4173

That is the entire surface you interact with day to day. See The CLI for the flags each one accepts.

The engines stay internal

Vantris is built on best-in-class engines, but it never exposes them:

  • esbuild — on-the-fly TypeScript/JSX transform in dev.
  • Rolldown — the production bundler (tree shaking, splitting, minify).
  • lightningcss — the CSS pipeline.

You configure Vantris, never these tools. There is deliberately no rolldownOptions escape hatch: every option is Vantris-owned and Vantris-typed (see the Configuration reference). The upside is that your config is a stable contract — an internal engine could be swapped without touching a single line of your vantris.config.ts.

Scope

Vantris targets React and vanilla JS/TS applications and libraries. In concrete terms, that means:

  • Applications — an index.html (or several) with module scripts, built into a hashed, minified bundle. See Building for Production.
  • Libraries — a single entry bundled into esm + cjs + iife in one pass. See Library Mode.

Feature overview

  • Instant dev server — native (Node.js & Bun), zero-dependency HTTP + WebSocket, on-the-fly TypeScript & JSX (React automatic runtime), and an in-browser error overlay.
  • 🔥 Hot Module Replacement — CSS hot-swaps with no reload; JS modules that import.meta.hot.accept() update in place, with a safe full-reload fallback. Typed, bidirectional WebSocket protocol.
  • 🧩 Plugins — extend dev + build with config, resolveId, load, transform, handleHotUpdate, and lifecycle hooks. Referenced by string, authored with definePlugin, ordered with enforce.
  • 📦 Smart dependency handling — bare imports are bundled on demand with correct CommonJS named exports and subpaths; optimizeDeps.include pre-bundles at startup, optimizeDeps.exclude serves native ESM.
  • 🔐 Networking — HTTPS (self-signed dev cert), proxy, CORS, SPA fallback.
  • 🏗️ Production build — Rolldown: tree shaking, minification, code splitting, content-hashed output, source maps (JS/TS/CSS), and build --watch.
  • 📚 Library mode — bundle one entry to esm + cjs
    • iife in a single build.
  • 🎨 Full CSS pipelineurl() rewriting, @import inlining, CSS Modules, Sass/Less, PostCSS, and CSS code splitting.
  • 🖼️ Asset handling — images, fonts, media, wasm, txt, and json; identical in dev and build. public/ is copied verbatim.
  • 🔧 define — inline global constants in dev and build.
  • 🧭 Zero-config aliases — falls back to tsconfig.jsonpaths/baseUrl.
  • ⚙️ Internal cache — transparent, self-invalidating, in node_modules/.
  • 🧪 Well tested & strict — 346 tests on Node and Bun (node:test), TypeScript strict everywhere.

Requirements

Vantris requires Node.js ≥ 20.11 (or Bun). It has no runtime dependency on a particular package manager — npm, pnpm, yarn, and bun all work.

Design principles

The codebase follows a handful of rules that shape the public behaviour:

  • TypeScript strict throughout.
  • No logic in the CLI — it only parses arguments and routes to a command.
  • Dependency injection — commands receive a Context (config, logger); no hidden global state.
  • Strong separation of concerns — the dev and preview servers share one HTTP bootstrap, so behaviour is identical under Node.js and Bun.
  • Errors are explicit — everything intentional throws a VantrisError subclass, rendered cleanly by the CLI.

Where to next

Released under the MIT License.