Build and Host

Ecopages owns build execution. Core uses Rolldown through the build adapter, including production server bundles, whether the process is Node or Bun. Each Ecopages plugin handler becomes a Rolldown plugin with a native filter, so Rolldown calls into JavaScript only for the modules a handler matches.

What gets built

  • Server entry — app bootstrap and request handling
  • Route modules — page and layout server modules per integration
  • Browser graphs — Page Browser Graph entries and chunks per route or route cohort
  • Static HTML — build-time output for static cache strategies

Development uses one-shot Rolldown builds with shared HMR and invalidation services; route-module and browser builds can run in parallel.

Runtime entrypoint

Apps start through createApp() from @ecopages/core/create-app. It uses the Node HTTP host on every runtime. The start log names Bun when the process is Bun. app.start() binds the port and serves traffic. Pass an optional callback to run once the server can accept requests.

See Starting the server for a full app.ts example and the callback signature.

Further reading