Dev server internals

manic dev — bunfig merge, Bun.spawn --watch config reload env injection.

Dev server internals

manic dev (packages/manic/src/cli/commands/dev.ts) never bundles your app inside the CLI process. It loadConfig(), writes bunfig.toml from plugin snippets, then Bun.spawn s:

bun --watch [--preload …] ~manic.ts

Bunfig merge

InputBehavior
plugins[].bunfigParsed for [serve.static] plugins = [...] — entries merged into one array
Other TOML snippetsAppended verbatim after the merged static block
Empty aside from headerFile not written

Child environment

VariableMeaning
PORTCLI --port → else config.server.port6070
HOST0.0.0.0 if --network, else localhost
NETWORK**true / false string

Config hot reload

If manic.config.ts / .js exists, fs.watch debounces 100 ms, kills the child, import() s the config module with a ?t= cache bust, and respawns — plugins + bunfig stay aligned without restarting manic dev manually.


Contrasts with production

ConcernDevProduction manic build
TransformOn demand via oxcPlugin(true) + HMR shimBun.build graphs + oxc-minify
Routes manifestwatchRoutes may touch ~manic.ts on structural changeswriteRoutesManifest without touch
API loadingapp/api sources via apiLoaderPluginBundled .js per index.ts

See also

On this page