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 "@hornjs/fest";
import { serveStatic } from "@hornjs/fest/static";
import { StreamRuntimeAdapter } from "@hornjs/fest/stream";
Runtime-Specific Imports
Node, Bun, Deno, and stream adapters live on explicit subpaths:
import { BunRuntimeAdapter } from "@hornjs/fest/bun";
import { DenoRuntimeAdapter } from "@hornjs/fest/deno";
import { NodeRuntimeAdapter } from "@hornjs/fest/node";
import { StreamRuntimeAdapter } from "@hornjs/fest/stream";
This keeps bundlers from guessing which runtime-specific module graph should be included.
Externalizing the Package
If your application bundle should keep fest as a runtime dependency, mark it
as external.
export default {
external: ["@hornjs/fest"],
};
import { build } from "esbuild";
await build({
entryPoints: ["src/server.ts"],
external: ["@hornjs/fest"],
});
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.
fest --entry ./server.tsx --import jiti/register