Bundler Usage

Prefer runtime-specific imports or externalization when bundling server code.

Core Import

The main entry exports runtime-agnostic primitives, while adapters and optional helpers stay on explicit subpaths:

import { Server, serve } from "sevo";
import { serveStatic } from "sevo/static";
import { StreamRuntimeAdapter } from "sevo/stream";

Runtime-Specific Imports

Node, Bun, Deno, and stream adapters live on explicit subpaths:

import { BunRuntimeAdapter } from "sevo/bun";
import { DenoRuntimeAdapter } from "sevo/deno";
import { NodeRuntimeAdapter } from "sevo/node";
import { StreamRuntimeAdapter } from "sevo/stream";

This keeps bundlers from guessing which runtime-specific module graph should be included.

Externalizing the Package

If your application bundle should keep sevo as a runtime dependency, mark it as external.

export default {
  external: ["sevo"],
};

Tree Shaking

The package declares "sideEffects": false, so unused subpath imports can be removed by bundlers that understand ESM tree shaking.

CLI and JSX Loaders

The CLI supports --import <module> for Node.js and Bun so you can preload runtime loaders such as jiti/register.

sevo --entry ./server.tsx --import jiti/register