Static sites

Build the files, then serve them with a static web server.

This pack does not compile a language runtime. For JS frontends, Node.jsruns npm run build first. See Buildpacksfor detection order.

Detects

  • static.toml in the base directory, or
  • A known static JS framework (Vite, Astro without a server adapter, Angular, Gatsby, and similar), or
  • package.json with a build script and no server entrypoint (server.js, index.js, …)

Next.js, Nuxt, and other SSR frameworks stay on the Node pack and are not served as static files, unless Next is set to output: 'export'.

Output directory

Resolved in this order:

  1. output-dir in static.toml
  2. The framework default (dist, out, build, public, _site, Angular’s nested dist/…/browser)
  3. The first of those folders that contains index.html
output-dir = "dist"
fallback = "index.html"

fallback is the SPA rewrite. If you omit it and index.html exists, Nodion uses that.

Start command

static-web-server on 0.0.0.0:$PORT (8080 if PORT is unset), with compression. Override with a Procfile if you must.