What is the Loader?
The NanoForge Loader is the runtime layer that starts a NanoForge project. It is invoked by the NanoForge CLI when you runnf start, and handles both sides of a game simultaneously: the client side delivered to the browser and the server side running in Bun.
The Loader is a monorepo of three packages, each with a distinct responsibility at runtime:
loader-client— the Bun HTTP server that serves the browser with the loader UI and the compiled game files.loader-server— the Bun process that runs the compiled server game code in an isolated worker.loader-website— the browser application that displays the loading screen, caches game files locally, and bootstraps the game.
Installation
Packages
loader-client
Bun HTTP server that serves the loader website and the compiled client game files. Exposes the
manifest, environment variables, and game assets. Supports HTTPS and hot-reload.
loader-website
Browser application bundled as static assets. Displays the loading screen, downloads and caches
game files via the browser Origin Private File System, then bootstraps the game.
loader-server
Bun process that runs the server-side game code in an isolated worker process. Supports
live-reload by restarting the worker on file changes.