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 "sevok";
import { serveStatic } from "sevok/static";
import { StreamRuntimeAdapter } from "sevok/stream";

Runtime-Specific Imports

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

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

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

Externalizing the Package

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

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

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.

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